betaFeedback

WorksComputer Science

Detect, Repair and Audit: A Hierarchical Multi-Agent Defense Against Adversarial Attacks in Energy Forecasting

Abstract

Accurate electricity-demand forecasting is essential for the modern energy infrastructure. Recently, Times-Series Large Language Models (TS-LLMs) have emerged as a promising approach to forecasting more accurate demand from historical consumption data in zero- and few-shot settings, helping energy operators effectively plan supply and allocate energy resources. However, these models are vulnerable to compromised sensor inputs that can distort forecasts and lead to erroneous market orders or unnecessary load shedding. Existing defenses focus primarily on end-device forecasting, overlooking the distinct data-drift, latency, and audit requirements across energy infrastructure. To address this gap, we extract from major energy standards and regulatory frameworks a three-layer conceptual model that captures the security postures for each layer. Guided by this model, we develop a Multi-Agent Reinforcement Learning (MARL) detector coupled with signal repair at local control centers, designed to mitigate distributional data drift through complementary feature-based detection and clean-reference-calibrated repair while meeting latency budgets. We further deploy an evidence-grounded LLM auditing agent with human-in-the-loop validation for audit-critical Virtual Power Plants (VPPs). In our evaluation, the best MARL configuration achieves an F1 score above 0.91 across all dataset-attack pairs, while signal repair reduces adversarial-to-clean input Relative Squared Error (RSE) by up to 83%. The few-shot auditor detects 77.78% of attacks in the Sherlock dataset. On the evaluated hardware, detection and repair require 7.95 ms on average, with a worst-observed latency of 14.50 ms, remaining within the local-center latency budget informed by IEEE 1646.

Introduction

With the rapid proliferation of AI, energy has emerged as a critical foundation for AI infrastructure, powering both the computational resources used to train large language models (LLMs) and the cloud infrastructure that delivers AI inference services to end users [3, 8]. Leading cloud providers are now securing direct nuclear supply agreements [26] and co-locating data centers adjacent to generation assets [18, 32]. Within this infrastructure, electricity-demand forecasts are fundamental data informing key decisions on supply scheduling, resource allocation, and market operations [23]. This growing reliance on energy infrastructure makes its security inseparable from AI service continuity. However, the need to protect this infrastructure is still underscored by real-world incidents. Industroyer malware exploited Operational Technology (OT) protocol automation to trigger the 2016 blackout [1], and federal agencies recently warned that state-sponsored actors are actively exploiting programmable logic controllers at US energy and water facilities [28]. To model defenses across this heterogeneous infrastructure, we synthesize major energy standards and regulatory frameworks covering device communication, grid cybersecurity, and distributed resource aggregation [5, 9, 10]. We derive from them a generalized three-layer model (Figure 1): resource-constrained end devices (L1L1), latency-sensitive local control centers (L2L2), and audit-critical Virtual Power Plants (VPPs, L3L3), with distinct computational, latency, and audit requirements (as detailed in § 3).

Figure 1. Three-layer energy infrastructure model: entities, cross-layer interactions and issues.

Traditional energy-demand forecasting relies on historical patterns (e.g., daily activity cycles and seasonal variations), while Time-Series Large Language Models (TS-LLMs) [7, 12, 15] leverage pre-trained representations for zero- and few-shot forecasting from historical data, making them a more promising demand forecasters at local control centers. However these capabilities do not guarantee robustness to distributional data drift: weather or behavioral changes (e.g., heatwaves increasing cooling demand) can shift demand away from historical distributions and reduce forecast accuracy. Beyond such benign changes, these models are vulnerable to adversarial perturbations [43], including black-box attacks that degrade forecasts using only input-output queries without parameter access [19, 43]. Yet existing defenses address only a fragment of this threat landscape. Specifically, adversarial training [13] can be costly for large TS-LLMs and overfit known attack distributions [31, 42], while randomized smoothing [4] provides guarantees under specific perturbation models that may not capture temporal attacks on energy data. Anomaly-detection classifiers (e.g., Isolation Forest [21], OC-SVM [36]) and signal filters (e.g., Kalman smoother [16], Savitzky-Golay [35]) must also accommodate benign distribution shifts [11, 22] rather than misclassifying or suppressing legitimate changes. Detection-only pipelines that discard suspicious inputs can interrupt forecast continuity, making signal repair an operational necessity. Meanwhile, detection and repair must also share the latency budget with message transmission when performed within control-message delivery paths subject to IEEE 1646’s 16 ms limit [14] (§ 3). Beyond forecasting, VPPs require cross-device OT-log investigation, but manual auditing faces substantial evidence-preparation burdens and gaps in auditors’ OT-domain knowledge [33]. Together, these gaps motivate adversarial detection and signal repair that accommodate benign distributional drift within latency constraints, complemented by evidence-grounded auditing at VPPs.

We address these gaps by modeling the energy infrastructure as three layers (§ 3) and developing a hierarchical defense that combines a cooperative Multi-Agent Reinforcement Learning (MARL) detector with Discrete Wavelet Transform (DWT)-based signal repair at local control centers (L2) with an evidence-grounded LLM auditing agent at VPPs (L3) (§ 4). We take distributional data drift into consideration through two complementary mechanisms. First, the MARL specialists combine evidence from six specialists, allowing the coordinator to assess a load change in context. Training across diverse temporal patterns and conditioning decisions on a rolling trusted context support context-responsive detection (§ 4.1). Second, for rejected inputs, a Discrete Wavelet Transform (DWT)-based repair module retrieves a similar clean historical window from the same user and calibrates wavelet soft-thresholds per window. Regarding latency, our experiments show that the full detection-and-repair pipeline achieves a mean latency of 7.95 ms and a worst observed latency of 14.50 ms on the evaluated hardware, both below the local-center budget (§ 5.6). At VPPs, the auditing agent correlates OT logs across devices to identify attacks and produces reports grounded in specific log entries for human-in-the-loop (HITL) validation (§ 4.3).

In summary, our contributions are threefold:

  • We systematically model energy infrastructure as three operational layers (i.e., end devices, local control centers, and VPPs) and formalize the threat model for each layer, identifying its data streams, attack surfaces, attacker objectives, and operational constraints (§ 3).

  • We develop a hierarchical defense framework combining cooperative MARL detection and DWT-based signal repair at local control centers with evidence-grounded LLM auditing and HITL validation at VPPs, addressing distinct latency and audit requirements while preserving forecast continuity (§ 4).

  • We evaluate local-center defense across three energy datasets under DGA [19] and GenIAS [6], and separately assess forensic auditing on Sherlock [41] benchmark. The best MARL configuration achieves F1 above 0.91 on every dataset–attack pair, DWT repair reduces adversarial-to-clean input RSE by up to 83%, and the few-shot auditing agent detects 77.78% of attack windows. On the evaluated hardware, detection and repair take 7.95 ms on average (14.50 ms worst observed), below the local-center budget (§ 5).

Related Work

In this section, we review (i) time-series forecasting models and input-side adversarial threats, and (ii) forecast-integrity defenses and audit-governance challenges in energy infrastructure.

Time-Series Forecasters and Attacks

Forecasting models. Time-series forecasting has progressed from statistical methods (e.g., ARIMA and exponential smoothing) to neural models (e.g., DeepAR [34] and LSTNet [17]) and Transformers (e.g., Informer [44] and PatchTST [29]). More recently, TS-LLMs offer zero- and few-shot forecasting capabilities. In this work, we study TimeGPT [12], TimesFM [7], and TimeLLM [15] to cover three distinct designs: cross-domain time-series pretraining, decoder-only forecasting, and language-model reprogramming. However, forecasting alone does not ensure robustness to adversarial inputs [43].

Input-side threats. Gradient-based attacks (e.g., FGSM/BIM [13] and PGD [24]) have been extended to time-series classification [30] and graph-based forecasting [20]. DGA [19] directly targets LLM-based forecasters through gradient-free model queries, producing misleading predictions with small input perturbations. GenIAS [6], originally developed for anomaly generation, synthesizes realistic anomalous sequences through latent-space perturbations. These methods perturb time-series inputs; in our setting, corrupting the edge meter’s readings can therefore bias local-center forecasts and lead to incorrect VPP market decisions, motivating protection beyond the forecasting model alone.

Defenses for Secure Energy Infrastructure

Forecast integrity. Ma et al. [23] detect adversarial TS-LLM inputs through sampling-induced divergence, checking forecast consistency across shortened input variants. TimeGPT [12] offers native anomaly detection, with its historical interface flagging observations outside prediction-based intervals. These detection mechanisms provide anomaly signals but do not specify how to repair adversarially perturbed inputs for downstream forecasting.

Audit governance. Sahin et al. [33] study NERC-CIP compliance in the US electric power sector, identifying heavy evidence-preparation burdens, gaps in auditors’ OT-domain knowledge, and a one-size-fits-all audit process. Their study characterizes governance and audit-practice challenges rather than an algorithmic mechanism for detecting OT attacks from device logs. These findings motivate evidence-grounded forensic assistance with human validation.

Cross-layer defense gap. These works address complementary security needs but do not jointly provide detection, input recovery, and forensic auditing under distributional data drift and layer-specific operational constraints. Our framework combines cooperative MARL detection with DWT-based repair at local control centers to preserve forecast continuity within their latency budgets, alongside evidence-grounded LLM auditing agent and human validation at VPPs.

Threat Model

This section formalizes the three-layer energy infrastructure model and analyzes the entities, data streams, attack surfaces, and attacker objectives at each layer. It then specifies the attacker capabilities relevant to our forecasting defense and log auditing, as well as the operational constraints and security needs of the infrastructure. Energy infrastructure modeling and attacker’s goal. Energy systems do not prescribe a fixed number of operational tiers, yet a recurring three-layer pattern emerges across major standards and regulatory frameworks: IEC 61850 separates field devices from bay-level and station-level control [9]; NIST’s smart-grid cybersecurity guidelines stratify assets by communication domain and trust boundary [5]; and FERC Order 2222 formalizes the aggregation of distributed energy resources under VPP-like entities that interface with wholesale markets [10]. We extract from these frameworks a three-layer conceptual model that captures the hardware, latency, and governance heterogeneity driving distinct security postures. Alternative architectures such as microgrids or community energy systems map onto the same three tiers. Figure 1 illustrates the entities, cross-layer interactions, and issues in this model. Telemetry flows from end devices to local centers for forecasting, and the forecasts inform VPP market and dispatch decisions.

Each layer handles distinct data streams, exposes a distinct attack surface, and admits a distinct attacker objective:

  • L1: End devices. Resource-constrained Advanced Metering Infrastructure (AMI) connected smart meters and IoT sensors reporting raw time-series telemetry. Attacker’s Goal: Inject perturbed readings to induce downstream forecast deviations large enough to move outside operational tolerance bands.

  • L2: Local centers. Latency-sensitive control systems (e.g., Battery Control System, Energy Management System) that aggregate upstream telemetry and run TS-LLM demand forecasters. Attacker’s Goal: At this layer, the attacker similarly seeks to distort forecasts through input manipulation, but targets the broader telemetry used for local-center forecasting and operational assessment rather than individual meter readings at L1. To evade detection, the attacker may inject smaller or operationally plausible perturbations, including gradual distribution shifts, to bias downstream market-bidding or battery-dispatch decisions.

  • L3: Virtual power plants (VPPs): Market-facing entities that aggregate site-level forecasts, Operational Technology (OT) logs, alarms, and balancing orders. Attacker’s Goal: Flood audit pipelines, forge logs, or execute OT-level command manipulation (e.g., Industroyer-class attacks [1]) to delay attribution and trigger incorrect market actions.

Attacker’s knowledge and capability.

(1) Black-box access: At the L1 and L2 layers, the attacker can query the operational TS-LLM forecaster but has no visibility into its parameters, gradients, or clean training data. Adversarial inputs are crafted via gradient-free or generative optimization [6, 19] (evaluated in § 5).

(2) Partial compromise: The attacker controls or impersonates a subset of telemetry or OT communication endpoints (e.g., smart meters) but does not obtain administrative control of the forecasting pipeline or the VPP itself.

(3) Defense knowledge: The attacker is aware of the defense mechanism existence and algorithmic logic, but does not know the specific calibrated parameters.

Design requirements. The defender cannot modify the frozen architecture or weights of the pre-trained TS-LLM, nor does it have access to online ground-truth labels. When scalar adversarial probabilities are required (e.g., for the decision-tree mechanism in § 4.1), an independent and lightweight projection layer is appended. This head serves as an external defense wrapper rather than a model modification. The following design requirements reflect the layer-specific constraints and auditing needs summarized in Figure 1:

  • R1 (End devices): Compute constraints. Resource constrained AMI hardware limits on-device computation. Since all L1 telemetries flow through L2 and the two layers share similar input-manipulation threat, we centralize detection and repair at L2 to address attacks originating at either layer.

  • R2 (Local centers): Latency & distributional data drift. The defense must operate online within strict latency budgets (i.e., 16ms under IEEE 1646 [14]) and accommodate benign changes in energy-data distributions over time (e.g., changes in renewable generation patterns [11, 22]), requiring both detection and immediate signal repair to preserve forecast continuity.

  • R3 (VPPs): Scalable forensic auditing. Large OT log volumes and persistent domain knowledge gaps among auditors [33] require efficient, evidence-grounded assistance for human forensic auditing. The auditing agent should automatically correlate OT logs across devices, identify suspicious events, and organize supporting evidence to reduce preparation effort and help auditors rapidly investigate attacks.

Defense Strategies

This section presents MARL detection and DWT-based repair at local control centers (L2), LLM-assisted forensic auditing at VPPs (L3), and the cross-layer orchestration of our framework. Building on our model and operational requirements in § 3, we first describe how cooperative MARL detection (§ 4.1) and DWT-based signal repair (§ 4.2) work together to protect forecast integrity and preserve forecast continuity under local-center latency constraints. We then present an evidence-grounded LLM forensic auditing agent designed to help human auditors efficiently investigate potential OT attacks (§ 4.3). Finally, we define the data flow and evidence contract connecting end-device telemetry, local-center detection and repair decisions, and downstream VPP operations (§ 4.4).

Cooperative Multi-Agent Reinforcement Learning (MARL) Detection

We adopt a cooperative Multi-Agent Reinforcement Learning (MARL) framework to optimise adversarial screening in the dynamic environment using five category of high-dimensional and heterogeneous features (e.g., time, prediction statistics, entropy, metrics, and forecast-model knowledge). These categories provide complementary evidence about temporal context, forecast behavior, prediction consistency, and model responses. Prediction statistics are computed independently on the full and internal predictions defined in the input pre-processing step below, yielding two distinct feature groups and thus six local observations in total (details in Appendix B). Each observation is assigned to a dedicated, separately parameterized specialist agent, which processes only its assigned feature group and emits an adversarial-confidence message. A coordinating policy fuses the six messages with the decision-tree depth and selects the binary operational action ata_t, where at=0a_t = 0 accepts the input and at=1a_t = 1 rejects it. All six specialists and the coordinator are trained jointly using a shared team reward, while the TS-LLM backbone remains frozen.

Algorithm 1 Decision tree mechanism for adversarial detection
Require: Full context $X$; forecasting pipeline $f$ (frozen backbone with appended projection head); DWT-based smoother $S$
Ensure: Detection probability Prob; depth $d$
1: $\mathrm{Prob}_0 \leftarrow f(X)$
2: if $\mathrm{Prob}_0 < 0.5$ then return $(\mathrm{Prob}_0, 0)$
3: $\tilde{X} \leftarrow S(X)$
4: if $f(\tilde{X}) < 0.5$ then return $(\mathrm{Prob}_0, 1)$
5: Split $\tilde{X}$ into odd/even subsequences $X^{\mathrm{odd}}, X^{\mathrm{even}}$
6: Front-pad both subsequences with zeros to length $\lvert X\rvert$
7: $\mathrm{Prob}_2^{\mathrm{odd}} \leftarrow f(X^{\mathrm{odd}}),\ \mathrm{Prob}_2^{\mathrm{even}} \leftarrow f(X^{\mathrm{even}})$
8: if $\max(\mathrm{Prob}_2^{\mathrm{odd}}, \mathrm{Prob}_2^{\mathrm{even}}) < 0.5$ then
9: return $(\mathrm{Prob}_2^{\mathrm{odd}} + \mathrm{Prob}_2^{\mathrm{even}}, 2)$
10: end if
11: return $(\mathrm{Prob}_0, 2)$

Input pre-processing. We denote the observed input window as the full context and the TS-LLM forecast as the full prediction. At inference time, the corresponding future observations are unavailable, so the actual forecasting error of the full prediction cannot be used as detection evidence. To obtain prediction-observation comparisons using only available data, we construct an internal forecasting task within the full context. Specifically, we split the full context chronologically into an earlier portion (i.e., internal context), and a later portion (i.e., internal ground truth). We front-pad the internal context with zeros to satisfy the forecaster’s input-length requirements and feed it into the same frozen TS-LLM to generate the internal prediction. Comparing this prediction with the internal ground truth enables the construction of entropy and metric features (details in Appendix B) without requiring future observations. The resulting six pre-processing streams are: (1) the prediction timestamps, (2) full context, (3) full prediction, (4) internal context, (5) internal prediction, and (6) internal ground truth.

Observations, joint state, and transition. From the six streams we construct a 100-dimensional feature vector spanning temporal, statistical, and information-theoretic domains (construction details in Appendix B), fit one anomaly-detection model per feature family whose output is the probability that the input is adversarial under that family’s evidence and partition it into the local observations ot1,…,ot6o_t^1,\ldots,o_t^6. Specialist agent i∈{1,…,6}i \in\{1,\ldots,6\} owns a separately parameterized trainable local policy hθih_{\theta_i} and emits pti=hθi(oti)∈[0,1]p_t^i = h_{\theta_i}(o_t^i) \in[0,1]. The scalar ptip_t^i is both the specialist’s adversarial confidence and its continuous communication action. The coordinator receives these six messages and concatenates them with the decision-tree depth to form the joint state:

st=[pt1,…,pt6,dt]∈R7,dt∈{0,1,2}.(1)s_t = [p_t^1,\ldots,p_t^6,d_t] \in\mathbb{R}^7,\qquad d_t \in\{0,1,2\}. \tag*{(1)}

The coordinator samples the binary operational action ata_t from πθc(at∣st)\pi_{\theta_c}(a_t \mid s_t); hence at=(pt1,…,pt6,at)a_t = (p_t^1,\ldots,p_t^6,a_t) is the hierarchical joint action, comprising six communication actions and one operational action. The depth records how far the decision-tree re-detection procedure escalated before committing to a verdict: dt=0d_t = 0 if the projection-augmented forecast pipeline classified the input as benign on the first pass, dt=1d_t = 1 if a smoothing probe was required to break a suspected perturbation, and dt=2d_t = 2 if an additional odd/even re-split was needed (full procedure in Algorithm 1 and Appendix B).

A larger dtd_t therefore simultaneously signals stronger adversarial evidence and a higher compute cost. Windows are processed chronologically. Accepting a window updates a rolling trusted-context buffer with the raw signal; rejecting it updates the buffer only with the repaired signal or the common fallback. Consequently, the joint action changes the context used to construct st+1s_{t+1} rather than reducing the problem to an independently shuffled binary classifier. The detector therefore adjusts its decisions to current evidence and evolving trusted context; this context adaptation does not require online ground-truth labels or imply online policy retraining.

Centralized training via reinforcement learning and label-free deployment. During offline training, the coordinating MLP policy πθc(at∣st)\pi_{\theta_c}(a_t \mid s_t) samples the binary operational action and the reward rtr_t scores it against the training-time label yt∈{0,1}y_t \in\{0,1\} (i.e., clean vs. adversarial) and against the compute already spent, summarised by dtd_t. We define rtr_t as a function of (at,dt)(a_t,d_t) given yty_t in (2), with ata_t entering through three outcome-dependent terms and dtd_t through a single latency term. During deployment, neither the agents nor the coordinator receives yty_t: they use only otio_t^i, the joint confidences, and dtd_t. Thus labels define the offline learning signal but are not an online assumption.

rt(at,dt;yt)=αAG⁡(at)−βAM⁡(at,yt)−γFA⁡(at,yt)−δLP⁡(dt).(2)r_t(a_t,d_t;y_t)=\alpha\operatorname{AG}(a_t)-\beta\operatorname{AM}(a_t,y_t)-\gamma\operatorname{FA}(a_t,y_t)-\delta\operatorname{LP}(d_t). \tag*{(2)}

Here Accuracy Gain (AG) rewards the mean–absolute–percentage-error improvement obtained when an adversarial error is avoided, Attack Miss (AM) and False Alarm (FA) penalise accepting adversarial inputs or rejecting clean ones respectively, and the Latency Penalty (LP) captures the compute cost implied by dtd_t (see Algorithm 1 in Appendix B). The policy is therefore incentivised to reject adversarial inputs with minimal overhead while being penalised for both misclassification and for gratuitous escalation on easy samples. All six specialists and the coordinator receive this same scalar team reward. Writing Θ={θ1,…,θ6,θc}\Theta=\{\theta_1,\ldots,\theta_6,\theta_c\}, training optimizes the joint objective

J(Θ)=EπΘ[∑t=0T−1ρtrt](3)J(\Theta)=\mathbb{E}_{\pi_\Theta}\left[\sum_{t=0}^{T-1}\rho^t r_t\right] \tag*{(3)}

where ρ\rho is the discount factor. PPO [37] or GRPO [38] updates every parameter block in Θ\Theta jointly; none of the six specialist models is frozen during MARL training (only the TS-LLM backbone remains frozen). This shared-reward, joint-update construction is the cooperative multi-agent component of the detector.

Mitigating distributional data drift in MARL. The specialists provide complementary evidence that characterizes consistency within the current window. The input features are engineered; joint training learns feature-conditioned confidence mappings and coordination. This combination is intended to help distinguish benign operating changes from perturbations that appear inconsistent across feature families. Diversified offline training exposes the agents to a balanced mix of temporal patterns across datasets, while the false-alarm penalty discourages excessive rejection of legitimate inputs. At deployment, the rolling trusted context changes subsequent observations. These are complementary generalization and context-conditioning mechanisms.

Adversarial Input Repair

Once the MARL detector (§ 4.1) flags an input as adversarial, the repair stage is invoked and returns a recovered signal on which the downstream TS-LLM can forecast.

Repair goal and metric. Let XcleanX_{\mathrm{clean}}, XadvX_{\mathrm{adv}}, and XrepairX_{\mathrm{repair}} denote the clean, adversarial, and repaired samples. For Z∈{Xadv,Xrepair}Z \in\{X_{\mathrm{adv}},X_{\mathrm{repair}}\}, we measure distortion relative to the clean sample (Eq (4)) using relative squared error (RSE) and the repair objective is to minimize RSE⁡(Xrepair,Xclean)\operatorname{RSE}(X_{\mathrm{repair}},X_{\mathrm{clean}}).:

RSE⁡(Z,Xclean)=∑i=1n(Xclean(i)−Z(i))2∑i=1n(Xclean(i)−X‾clean)2.(4)\operatorname{RSE}(Z,X_{\mathrm{clean}})=\frac{\sum_{i=1}^{n}\left(X_{\mathrm{clean}}^{(i)}-Z^{(i)}\right)^2}{\sum_{i=1}^{n}\left(X_{\mathrm{clean}}^{(i)}-\overline{X}_{\mathrm{clean}}\right)^2}. \tag*{(4)}

Discrete wavelet transform (DWT) and parameter scope. We use a fixed four-level (J=4J=4) Discrete Wavelet Transform (DWT) across all samples. The transform decomposes a signal into one low-frequency approximation band and JJ high-frequency detail bands; soft-thresholding the detail coefficients and reconstructing the signal suppresses high-frequency perturbations while retaining the dominant consumption trend. We write Repair⁡(Xadv,P)→Xrepair\operatorname{Repair}(X_{\mathrm{adv}},P)\to X_{\mathrm{repair}}, where P=(ψd,{λj}j=1J,αu)P=(\psi_d,\{\lambda_j\}_{j=1}^{J},\alpha_u). The wavelet family ψd\psi_d is selected once from the clean training partition for dataset dd, and the blending ratio αu\alpha_u is calibrated only from user uu’s clean training history. At runtime, these quantities and JJ remain fixed; for each rejected window, the repair stage retrieves a user-local clean reference and adapts only the per-level soft-threshold multipliers {λj}\{\lambda_j\}.

User-local reference retrieval and per-window threshold calibration. Under the black-box threat model of § 3, the repair stage cannot query, simulate, or synthesize attack-specific samples; its calibration anchor must therefore be derived entirely from clean historical data already held by the operator. At onboarding, for each user uu, the operator constructs a user-local historical pool Xpool(u)X_{\mathrm{pool}}^{(u)} exclusively from that user’s clean training-period data and caps the pool at 10,000 sliding windows. Each user-local pool is indexed offline using a Hierarchical Navigable Small World (HNSW) graph [25] for approximate nearest-neighbor retrieval. When the MARL coordinator rejects an incoming window Xadv(u)X_{\mathrm{adv}}^{(u)}, the HNSW search returns an approximate RSE-nearest clean reference:

ı^=HNSW⁡RSE(Xadv(u);Xpool(u)),X^clean−ref=Xpool,ı^(u).(5)\hat{\imath}=\operatorname{HNSW}_{\mathrm{RSE}}\left(X_{\mathrm{adv}}^{(u)};X_{\mathrm{pool}}^{(u)}\right),\qquad\widehat{X}_{\mathrm{clean-ref}}=X_{\mathrm{pool},\hat{\imath}}^{(u)}. \tag*{(5)}

Here, HNSW⁡RSE\operatorname{HNSW}_{\mathrm{RSE}} denotes an approximate search for the reference minimizing RSE⁡(Xadv(u),Xpool,i(u))\operatorname{RSE}(X_{\mathrm{adv}}^{(u)},X_{\mathrm{pool},i}^{(u)}). With the decomposition depth JJ, dataset-level wavelet family ψd\psi_d, and user-level blending ratio αu\alpha_u fixed as described above, the repair stage adapts only the per-level soft-threshold multipliers for the current rejected window:

{λj⋆}j=1J=arg⁡min⁡{λj}j=1J RSE⁡(Repair⁡(Xadv(u),(ψd,{λj}j=1J,αu)),X^clean−ref).(6)\{\lambda_j^\star\}_{j=1}^{J}=\underset{\{\lambda_j\}_{j=1}^{J}}{\arg\min}\ \operatorname{RSE}\left(\operatorname{Repair}\left(X_{\mathrm{adv}}^{(u)},\left(\psi_d,\{\lambda_j\}_{j=1}^{J},\alpha_u\right)\right),\widehat{X}_{\mathrm{clean-ref}}\right). \tag*{(6)}

This per-window calibration allows the shrinkage at each decomposition level to respond to the scale-specific differences between the rejected window and its retrieved clean reference. The resulting signal,

Xrepair=Repair⁡(Xadv(u),(ψd,{λj⋆}j=1J,αu)),(7)X_{\mathrm{repair}}=\operatorname{Repair}\left(X_{\mathrm{adv}}^{(u)},\left(\psi_d,\{\lambda_j^\star\}_{j=1}^{J},\alpha_u\right)\right), \tag*{(7)}

is forwarded to the downstream forecaster in place of Xadv(u)X_{\mathrm{adv}}^{(u)}. Because the procedure uses only the user’s clean training history, the current rejected window, and its retrieved reference, it requires neither the attacker’s algorithm or attack identity, nor a test label nor the unavailable clean counterpart of the attacked window; and is therefore attack-agnostic under our black-box threat model. Crucially, X^clean−ref\widehat{X}_{\mathrm{clean-ref}} is used strictly as a calibration anchor and is never substituted for the live input.

Role in mitigating distributional data drift. Selecting a reference for the current window and recalibrating its thresholds avoids using one fixed shrinkage setting for all operating patterns. The historical reference may not fully capture the current operating context (e.g., weather-driven load, scheduling shifts, or behavioral variations) that remains present in Xadv(u)X_{\mathrm{adv}}^{(u)}; forwarding it directly would replay an outdated pattern. Repair therefore remains centered on the live input, with reference-calibrated detail-band shrinkage designed to retain benign temporal structure while suppressing perturbations. The reference pool remains fixed after onboarding: this is per-window parameter calibration, not online acquisition of new clean samples. Its ability to accommodate drift depends on representative same-user history; an unseen regime may lack a suitable reference, motivating the confidence gate below. The reported DWT-latency includes HNSW retrieval, per-level threshold calibration, inverse-DWT reconstruction, and blending.

Reference-confidence gate. Before per-window threshold calibration, we permit repair only when a reference is available and RSE⁡(Xadv(u),X^clean−ref)≤τu\operatorname{RSE}(X_{\mathrm{adv}}^{(u)},\widehat{X}_{\mathrm{clean-ref}})\leq\tau_u. The user-specific threshold τu\tau_u is a pre-selected upper quartile of nearest-reference distances from clean historical calibration windows, disjoint and non-overlapping with the reference pool. Calibration uses the same retrieval and distance computation as deployment, with a fixed positive denominator floor for near-constant reference windows; no test labels or attack identities are used. If the gate fails or history is unavailable, we abstain from DWT repair and use the common persistence forecast. This gate screens reference mismatch rather than guaranteeing repair safety; the un-gated variant omits the distance check.

LLM Forensic Auditing Agent

To accelerate forensic auditing and support accurate investigation of potential OT attacks at VPPs, we deploy an LLM-based forensic auditing agent that operates over device error logs from the target infrastructure. The agent’s workflow consists of four stages:

  • Input ingestion. The agent receives an accumulated OT-log window L\mathcal{L}, together with a run-time candidate-attack set A\mathcal{A} describing the attack types relevant to the deployment. In the Sherlock evaluation, this set contains Industry, Drift-Off, Control & Freeze, and ARP Spoofing DoS.

  • Reasoning and correlation. The agent analyzes log entries across devices and time windows, correlating anomalous patterns (e.g., repeated OT command sequences, measurement discontinuities, and communication disruptions) to reconstruct candidate attack narratives. Attack hypotheses are restricted to types in A\mathcal{A}.

  • Evidence-grounded reporting. To mitigate hallucinations and unsupported claims, every anomaly flag must be grounded

in specific log entries, including timestamps, device identifiers, and log content. Each proposed attack hypothesis must be supported by this cited evidence.

  • Escalation output. The agent produces a structured report containing the supported attack hypothesis, log evidence, affected assets, and a recommended action. It returns an empty anomaly list if the logs support no candidate type.

The agent operates as a forensic filter within a human-in-the-loop (HITL) system: it surfaces potential threats with supporting evidence and recommends escalation, but cannot autonomously execute remediation actions. Final validation and control-action authority remain with human auditors. This design is intended to reduce the evidence-preparation burden and help bridge the OT-domain knowledge gap identified by Sahin et al.

Cross-Layer Orchestration and Evidence Contract

The components described above are connected through a cross-layer data flow (as shown in Figure 1) and a common evidence contract that records their processing decisions and downstream consequences. End devices (L1) forward telemetry to local centers (L2), where the MARL detector screens each input window. Accepted windows are used directly for forecasting, whereas rejected windows undergo DWT-based repair when permitted by the reference-confidence gate. If the gate abstains, the system uses a persistence forecast to preserve forecast continuity; the same fallback is used across all ablations. The resulting forecast is then forwarded to the VPP (L3), where it informs the net-load bid and subsequent operational decisions.

To make this process traceable, each input window is assigned an event identifier and a hash of the received values. At L2, the record is extended with the six specialist confidences, local actions, coordinator action, and decision-tree depth. Repair-related fields include the selected clean-reference identifier and distance, DWT parameters, repaired-signal hash, and before/after forecasts, where applicable. At L3, the VPP appends the forecast-derived net-load bid and any operator action. These records are serialized as timestamped entries in the VPP audit log.

All entries associated with the same telemetry window retain the same event identifier. This linkage allows operators to trace an L1 observation through its L2 detection and repair decisions to its recorded L3 consequences, without requiring access to complete raw user histories for record association. The evidence contract therefore specifies how cross-layer records are organized and linked, while the forensic-auditing workflow in §4.3 describes how OT logs are analyzed to support human investigation and validation.

Experiment and Evaluation

The full experiment setup is documented in Appendix A. In this section, we first evaluate MARL detection performance (§5.1), then compare coordination strategies (§5.2), assess input repair and downstream forecast recovery (§5.3), and examine DWT repair baselines and robustness to reference-history conditions (§5.4). We separately evaluate VPP log forensic auditing on the Sherlock [41] benchmark (§5.5) and finally measure L2 runtime overhead (§5.6).

Note: AD refers to anomaly-detection.

Fusion methodPrecision (↑)Recall (↑)FPR (↓)F1 (↑)AUPRC (↑)Latency (ms) (↓)Cost (↓)
Majority Vote0.8890.8610.1080.8750.9010.0060.168
Weighted Vote0.9130.8990.0760.9060.9290.0090.133
Logistic Regression0.9250.9160.0620.9200.9450.0250.116
Random Forest0.9420.9340.0450.9380.9630.1880.094
XGBoost0.9500.9430.0380.9460.9720.1540.086
Supervised MLP0.9540.9480.0340.9510.9770.0660.080
MARL (PPO)0.9600.9540.0280.9570.9820.0820.070
MARL (GRPO)0.9690.9620.0220.9650.9870.0870.059

Table 2. Coordination strategy comparison

Adversarial Detection Performance

We evaluate the MARL detector (§4.1) using PPO [37] and GRPO [38], both with a learning rate of 10−310^{-3}. During training, each RL-algorithm jointly updates all six specialist models and the coordinator; at inference time, none of them receives a ground-truth label. We use TimesFM [7] and TimeLLM [15] as frozen forecasting backbones and train the MARL detector around each backbone without updating its parameters. In contrast, TimeGPT [12] is a closed-source commercial forecaster with a native anomaly-detection endpoint. We evaluate this endpoint directly on the same held-out windows as an independent baseline.

Table 1 reports the F1 scores on the held-out test sets. Our best configuration, GRPO+TimeLLM, achieves F1 > 0.91 on every dataset–attack pair. Under DGA, it reaches 0.9923, 0.9911, and 0.9198 on NI, HECP, and Electricity, respectively; the corresponding scores under GenIAS [6] are 0.9996, 1.0000, and 0.9841. TimesFM-based configurations achieve F1 scores of 0.7778–0.7882 on HECP [39] and Electricity [40] under DGA. However, TimeLLM’s advantage is not consistent across optimizers: on HECP under DGA, PPO+TimeLLM scores 0.7778, slightly below PPO+TimesFM (0.7867). All four MARL configurations outperform the TimeGPT [12] commercial native anomaly-detection baseline on every dataset–attack pair, whose F1 never exceeds 0.3156.

Attack ApproachDataset (# Samples)TimesFM [7] PPOTimesFM [7] GRPOTimeLLM [15] PPOTimeLLM [15] GRPOTimeGPT [12] (Native AD)
DGA [19]NI [27] (9058)0.91240.93750.91440.99230.1536
HECP [39] (450)0.78670.77780.77780.99110.3516
Electricity [40] (8672)0.78660.78820.87210.91980.2312
GenIAS [6]NI [27] (9058)0.98590.99180.98980.99960.2527
HECP [39] (450)0.97780.98220.97781.00000.1622
Electricity [40] (8672)0.91370.94580.91950.98410.3149

Table 1. The performance of adversarial detection.

Takeaway 1: Our MARL detector, built on open-source TS-LLMs wrapped in a RL policy over the §4.1 feature vector, outperforms the commercial baseline on all three datasets under both DGA and GenIAS attack; the best configuration (GRPO + TimeLLM) achieves F1 > 0.91 across every dataset–attack pair.

Coordination Strategies Comparison

To compare coordination strategies, every method uses the same six local observation definitions, decision-depth input, and evaluation splits. Trainable components are optimized under each method’s own objective. Because the full MARL configurations jointly update the six specialists and the coordinator, their post-training confidence messages are not constrained to be numerically identical to those of the non-RL baselines. Splits are chronological for region datasets and user-held-out for Electricity [40], preventing overlapping-window leakage.

Table 2 therefore reports a matched-input end-to-end coordination comparison rather than a frozen same-state fusion-only ablation. The cost combines normalized penalties for attack misses, false alarms, and latency. GRPO achieves the highest F1 (0.965), reduces FPR from 0.034 for the supervised MLP to 0.022, and lowers normalized operational cost from 0.080 to 0.059.

Repair Performance

We select the data-level wavelet family from the clean training samples and evaluate the DWT repair procedure (§ 4.2) under DGA [19] and GenIAS [6], assessing both input recovery and downstream forecast recovery.

The repair/ rows of Table 3 compare adversarial and repaired inputs against their clean counterparts. DWT repair reduces input-space RSE in all six dataset–attack settings, by 34.73%–60.74% under DGA [19] and 38.91%–83.36% under GenIAS [6]. We next assess downstream recovery by comparing forecasts from adversarial inputs (PadvP_{adv}) and repaired inputs (PsmoothP_{smooth}) against the clean-input forecast (PcleanP_{clean}). Forecast-space RSE decreases in every evaluated setting. TimeLLM [15] achieves reductions of 39.04%–63.04% under DGA and 39.91%–89.04% under GenIAS [6]; the corresponding ranges for TimesFM [7] are 9.39%–44.75% and 9.70%–22.09%. TimeLLM [15] shows larger relative reductions in all six settings.

Takeaway 2: DWT repair reduces input-space RSE by 34.73%–83.36% and lowers forecast-space RSE by up to 89.04% on TimeLLM and 44.75% on TimesFM, relative to their respective clean baselines.

Repair Baselines and Robustness

Evaluation protocol. We evaluate each repair method on actual detector rejections, including clean false positives when measuring clean distortion and harm. Test labels, attack identities, and clean counterparts of rejected windows are used only for post-hoc evaluation. The primary DWT setting uses 10K same-user clean training windows under in-season conditions, with reference construction and calibration following § 4.2. Harm is the fraction of repaired samples whose downstream forecast error increases by more than 1% after repair.

Repair baselines and confidence gating. Table 4 compares the adaptive DWT design with two generic signal smoothers and a fixed-parameter DWT. Savitzky–Golay filtering and Kalman smoothing have the lowest latency (0.31 ms and 0.44 ms), but provide only 31.6% and 35.8% RSE reduction, respectively, while producing clean distortion of 2.9% and 2.4% and harm rates of 12.7% and 10.8%. Fixed DWT improves the RSE reduction to 42.6% and lowers clean distortion and harm to 2.0% and 8.1%, respectively, at 0.61 ms. Adapting the four per-level thresholds increases the RSE reduction to 63.4% without gating, while reducing clean distortion to 1.3% and harm to 5.4%. Adding the confidence gate sacrifices only 1.6 percentage points of RSE reduction (63.4% to 61.8%) and adds 0.03 ms of latency (2.32 ms to 2.35 ms), but reduces clean distortion from 1.3% to 0.6% and harm from 5.4% to 2.1%. Thus, per-window threshold adaptation provides the principal repair gain, while confidence gating substantially limits repair-induced damage on unreliable references and false-positive detector outputs.

Reference-pool robustness. Table 5 examines sensitivity to reference-pool size, history relation, and operating condition. For gated DWT, repair coverage is the fraction of detector rejections passing the reference-confidence gate. Under same-user, in-season matching, increasing the historical pool from 100 to 1K and 10K windows raises RSE reduction from 50.9% to 58.7% and 61.8%, while repair coverage increases from 86.0% to 91.7% and 94.2%. Over the same progression, clean distortion decreases from 1.1% to 0.8% and 0.6%, and harm falls from 4.6% to 3.0% and 2.1%. This improvement incurs a moderate latency increase from 1.71 ms to 1.98 ms and 2.35 ms. Holding the pool size at 10K isolates reference mismatch: cross-user matching reduces RSE reduction to 45.6%, increases harm to 6.8%, and lowers coverage to 78.4%; seasonal shift further reduces RSE reduction to 42.8%, with 8.4% harm and 72.6% coverage; and rare-event windows are the most difficult non-missing-history condition, yielding 29.4% RSE reduction, 9.7% harm, and 55.1% coverage. Their nearly identical latencies (2.34–2.36 ms) show that these degradations arise from reference mismatch rather than additional computation. When no historical reference is available, the gate performs no DWT repair and invokes the common fallback, producing 0.0% repair coverage, RSE reduction, clean distortion, and repair-induced harm at 0.08 ms. These results expose the method’s dependence on representative same-user history while showing that the confidence gate reduces coverage instead of forcing repair with an unreliable reference.

Audit Agent Performance

We evaluate the LLM auditing agent on the Sherlock benchmark [41], which was generated with the Watson simulator [2] and contains over 30 days of power-grid behavior in basic, semi-urban, and rural scenarios. We use the basic test set to evaluate both zero-shot and few-shot learning and the semi-urban test set to provide few-shot examples, as the training data contain no attacks. We examine attack-type coverage, the detection–false-alert trade-off, and the final configuration’s sensitivity to degraded logs and prompt-example ordering.

The Sherlock [41] benchmark covers four OT attack types: In-dustroyer disrupts grid operations through malicious commands; Drift-Off uses a man-in-the-middle (MITM) attack to manipulate measurements and mislead the control center (CC); Control & Freeze conceals grid disruptions through MITM replay and interpolation of recorded measurement trends; and ARP Spoofing DoS disrupts CC–remote terminal unit communications through ARP spoofing.

The agent we employ is Claude Code, an agentic LLM assistant with strong code and log comprehension capabilities. For zero-shot evaluation, we provide the four-type runtime candidate set and the device error log; for few-shot learning, prompts include additional examples drawn from the semi-urban test set (log files and ground-truth attack labels). Consistent with the human-in-the-loop design of §4.3 (i.e., the agent surfaces, the human authorizes), both settings ran the agent in plan mode: the agent drafted an analysis plan and waited for operator approval before executing it. In the evidence-gated few-shot configuration, a proposed anomaly flag is retained for reporting only if its cited timestamp, device identifier, and log line match the input log, following the evidence-grounding constraint of §4.3.

Dataset (# Samples)ComponentDGA [19]GenIAS [6]
Adv. RSESmoothed RSEGapReduction (%)Adv. RSESmoothed RSEGapReduction (%)
NI [27] (22645)repair (sym2)2.42391.5797-0.844134.826711.54481.9207-9.624183.3629
TimesFM0.65830.5947-0.06369.66001.27770.9955-0.282222.0900
TimeLLM0.83230.4168-0.415649.930010.41691.1412-9.275789.0400
HECP [39] (1123)repair (bior2.4)2.52021.6449-0.875334.73019.52441.7693-7.755181.4237
TimesFM0.51750.4690-0.04869.38801.11240.9617-0.150713.5500
TimeLLM1.18610.7230-0.463139.04005.41590.6298-4.786188.3700
Electricity [40] (21680)repair (coif1)519362.7782203883.7931-315478.985160.7435144.042587.9886-56.054038.9149
TimesFM3626.81602003.9780-1622.838044.75452258.1052408389.6982-43868.40709.7000
TimeLLM25.40659.3905-16.016063.0400196.0906117.8389-78.251739.9100

Table 3. DWT repair performance: input-space RSE (repair/* rows) and forecast-space RSE (TimesFM [7]/TimeLLM [15] rows), each measured relative to its clean baseline.

RepairRSE Reduction ↑Clean Distortion ↓Harm ↓Latency (ms)
Savitzky–Golay31.6%2.9%12.7%0.31
Kalman Smoother35.8%2.4%10.8%0.44
Fixed DWT42.6%2.0%8.1%0.61
Adaptive DWT (w/o gate)63.4%1.3%5.4%2.32
Adaptive DWT (w gate)61.8%0.6%2.1%2.35

Table 4. Repair baselines on actual detector outputs.

PoolHistory RelationOperating ConditionRSE Reduction (↑)Clean Distortion (↓)Harm (↓)Repair CoverageLatency (ms)
100Same userIn-season50.9%1.1%4.6%86.0%1.71
1KSame userIn-season58.7%0.8%3.0%91.7%1.98
10KSame userIn-season61.8%0.6%2.1%94.2%2.35
10KCross userIn-season45.6%1.7%6.8%78.4%2.34
10KSame userSeasonal shift42.8%2.1%8.4%72.6%2.36
10KSame userRare-event window29.4%2.6%9.7%55.1%2.35
0Missing historyAny0.0%0.0%0.0%0.0%0.08

Table 5. Adaptive-DWT confidence-gate stress test across reference-pool sizes, history relations, and operating conditions. Cross-user matching is a stress-test condition only.

Attack Type# SamplesZero ShotFew Shot
Industroyer767
Drift Off422
Control & Freeze514
ARP Spoofing DOS201
Total18914

Table 6. Performance on attack detection from devices log.

Table 6 presents detections by attack type on 18 attack windows. The agent detects 9/18 in the zero-shot setting (50%) and 14/18 with few-shot examples (77.8%). The largest gain is for Control & Freeze (1/5 to 4/5); Industroyer improves from 6/7 to 7/7, whereas Drift-Off remains at 2/4 and ARP Spoofing DoS reaches only 1/2. Thus, the added examples improve attack coverage unevenly across families.

Attack-only detection rates do not capture the false alerts that human auditors must review. Table 7 therefore includes 180 benign windows alongside the 18 attack windows and compares rule-based signatures, a single-pass LLM, plan-mode zero-shot, and the few-shot evidence-gated agent. The final configuration detects 14 attacks with 5 false positives (73.7% precision, 77.8% recall, 2.8% FPR, and 75.7% F1), compared with 13 true positives and 16 false positives for the single-pass LLM, and 11 and 8, respectively, for rule-based signatures. Plan-mode zero-shot alone detects only 9 attacks with 12 false positives; the observed advantage is for the complete few-shot evidence-gated configuration, not for planning in isolation. Its 5 false alerts over the 30 evaluated days (0.17/day) remain a direct review-burden proxy rather than a negligible cost.

AuditorTP/FP/TN/FNPrecisionRecallFPRF1False Alerts (per day)
Rule-based signatures11/8/172/757.9%61.1%4.4%59.5%0.27
Single-pass LLM13/16/164/544.8%72.2%8.9%55.3%0.53
Plan-mode + zero-shot9/12/168/942.9%50.0%6.7%46.2%0.40
Plan-mode + few-shots + evidence gate14/5/175/473.7%77.8%2.8%75.7%0.17

Table 7. Audit evaluation on 18 attack windows and 180 benign windows spanning 30 days.

Performance on intact logs does not establish behavior when audit evidence is incomplete or corrupted. Table 8 fixes the few-shot evidence-gated configuration and tests it over three runs with missing lines, token noise, truncated logs, or shuffled prompt examples (not reordered log lines). With 25% truncation, recall falls from 77.8±3.2% to 66.7±3.2% and abstention rises from 4.8% to 17.4%; with 10% token noise, FPR rises from 2.8±0.6% to 3.5±0.9%. Evidence-valid is the fraction of retained flags that pass the strict timestamp/device/log-line parser after filtering. The reported 100% is conditional on retained flags; it does not measure validity among raw proposed flags or correctness of the attack diagnosis. Unmatched citations are withheld from escalation, and retained reports remain subject to human validation before any control action.

ConditionRecallFPREvidence-validAbstain
Original logs77.8±3.2%2.8±0.6%100%4.8%
10% lines missing74.1±3.2%3.1±0.7%100%8.6%
10% token noise72.2±4.8%3.5±0.9%100%10.1%
25% truncation66.7±3.2%2.4±0.5%100%17.4%
Prompt examples shuffled75.9±3.2%3.0±0.8%100%6.2%

Table 8. Three-run sensitivity of few-shot evidence-gated auditor.

Takeaway 3: Our forensic auditing pairs four-stage LLM auditing agent with human-in-the-loop validation, catching 77.78% of OT-level attacks overall and 100% of Industroyer-class incidents in the few-shot setting, directly addressing the preparation burden and OT-domain knowledge gap.

Performance Overhead

The full GRPO+TimeLLM MARL+DWT detection-and-repair pipeline, running under our workstation (AMD Ryzen 9 9950X+NVIDIA RTX 6000 Ada), completes in 7.95 ms (mean) and 14.50 ms (worst observed) on every sampled window across all three datasets, strictly below the 16 ms budget.

Conclusion

This work models energy infrastructure as three operational layers and presents a constraint-driven framework combining cooperative MARL detection and DWT-based signal repair at local centers with evidence-grounded LLM forensic auditing at VPPs. A common cross-layer record supports traceability, while the framework targets forecast continuity under distributional data drift and assists human forensic investigation. Across three energy datasets under DGA and GenIAS, the best MARL configuration achieves F1F1 above 0.91 on every dataset–attack pair and repair reduces adversarial-to-clean input RSE by up to 83%; the few-shot auditor detects 77.78% of attack windows in the separate Sherlock evaluation, including all seven evaluated Industroyer-class incidents. On the evaluated hardware, detection and repair take 7.95 ms on average (14.50 ms worst observed), below the local-center budget.

Appendix

Experiment Setup

Dataset: We use three real-world hourly electricity datasets: NI [27], covering over 10 years of consumption across 12 PJM regions or companies; HECP [39], covering 6.5 years of consumption and production in Romania; and Electricity [40], containing consumption records for 321 clients during 2012–2014. NI and HECP are regional datasets; Electricity is user-level, preprocessed from UCI following Lai et al. [17], with each client treated as a univariate series.

Input Processing Settings. We use length-256 sliding windows with stride 48 to meet model input constraints. For comparable per-dataset MARL sample budgets § 5.1, we select 40 Electricity [40] clients with a fixed random seed and split their IDs 80/20 (32 training, 8 held-out test). NI [27] and HECP [39] use chronological 80/20 splits. All splits precede windowing. We generate adversarial counterparts with DGA [19] and GenIAS [6], labeling clean/adversarial samples 0/1 for MARL Accept/Reject. Each Electricity client’s windows and their adversarial counterparts remain in one partition. With 542 windows per client, the Electricity test set contains 4,336 clean windows and 8,672 labeled clean/adversarial samples per attack (See Table 1).

Forecast Models. We use TimesFM-2.5 [7] and TimeLLM with a LLaMA backend [15] as frozen MARL forecasting backbones, and TimeGPT-1.0’s native anomaly-detection endpoint [12] as an independent baseline.

Feature Vector Construction

From the six pre-processing streams, we construct five local observations: 10 time features, two independent sets of 31 statistics from the full and internal predictions, 12 entropy features, and 16 error/relationship metrics, totaling 10+31+31+12+16=10010+31+31+12+16=100 dimensions. The sixth observation provides forecast-model knowledge to the projection-head/decision-tree specialist and is separate from this engineered vector; its confidence output is not an additional input feature. The details of the captured features are below.

  • Time Features (10-dimensions): The input timestamp data follows the format “yyyy-mm-dd hh:mm:ss”. We extract time-related features comprising six numeric features (i.e., the sine and cosine of the hour, day of the week, and month) and four categorical features (i.e., weekend, season, peak hour, and business hour). The peak hours are defined as 7–11 AM and 5–9 PM, while the business hours are defined as 9 AM–5 PM on weekdays.

  • Prediction Statistic Features (31 + 31 = 62 dimensions): We independently compute the same 31 statistics on the full-context and internal-context predictions, yielding two separate 31-dimensional local observations. Each observation includes basic statistics (mean, standard deviation, variance, minimum, maximum, range); percentiles (10th, 25th, median, 75th, 90th, interquartile range); normalized metrics (coefficient of variation, normalized absolute deviation); shape descriptors (skewness, kurtosis); trend indicators (slope trend, mean absolute change, total variation, number of direction changes); peak features (number of peaks, number of troughs, average peak-to-trough ratio); stability measures (median absolute deviation, root mean square, lag-1 autocorrelation, Shannon entropy); and energy-related features (load factor, base load, peak load, roughness).

  • Entropy Features (12 dimensions): To extract the entropy features, we paired the internal predictions with the corresponding internal ground truth. We then derived 12 entropy-related metrics across several categories: distribution-based entropy (i.e., KL divergence, JS divergence, Wasserstein distance, and differential entropy ratio), time-series complexity (i.e., permutation entropy, sample entropy, and approximate entropy), spectral measures (i.e., spectral entropy and spectral flatness), and information-theoretic entropy (i.e., mutual information, conditional entropy, and continuous cross-entropy).

  • Metrics Features (16 dimensions): The metrics features are also computed by pairing the internal predictions with the corresponding ground truth. We extract 16 metrics across several categories: error metrics (MAE, MSE, RMSE, MASE), correlation metrics (Pearson, Spearman, and cosine similarity), regression metrics (R2R^2 and explained variance), percentage-based metrics (MAPE and SMAPE), directional metrics (directional accuracy and sign accuracy), and time-series metrics (DTW distance, peak-or-valley alignment, and maximum error).

  • Forecast Model Knowledge (separate observation). This observation uses the projection-augmented forecaster in § 3 and is separate from the 100-dimensional engineered vector. Algorithm 1 first scores the full context to obtain Prob0Prob_0, stopping if Prob0<0.5Prob_0 < 0.5. Otherwise, it applies smoothing and re-evaluates the input. If the result remains suspicious, it tests odd/even subsequences of the smoothed context, each front-padded with zeros to

preserve the original input length. A benign verdict after smoothing, or on both subsequences, is interpreted as evidence that the transformation disrupted an adversarial pattern. The procedure retains Prob0Prob_0 unless both subsequence scores are below 0.5, in which case their sum is returned. Depths zero, one, and two correspond to the initial, smoothing, and odd/even checks, respectively. The returned confidence provides the sixth specialist’s message, while depth d∈{0,1,2}d \in\{0, 1, 2\} records the probe stage for the coordinator’s joint state.

References

References

  1. [1]Doney Abraham, Siv Hilde Houmb, and Laszlo Erdodi. 2025. Cyber-Attacks on Energy Infrastructure—A Literature Overview and Perspectives on the Current Situation. Applied Sciences 15, 17 (2025), 9233.DOI
  2. [2]Lennart Bader, Martin Serror, Olav Lamberts, Ömer Sen, Dennis van der Velde, Immanuel Hacker, Julian Filter, Elmar Padilla, and Martin Henze. 2023. Comprehensively analyzing the impact of cyberattacks on power grids. In 2023 IEEE 8th European Symposium on Security and Privacy (EuroS&P). IEEE, 1065–1081.DOI
  3. [3]Xin Chen, Xiaoyang Wang, Ana Colacelli, Matt Lee, and Le Xie. 2025. Electricity demand and grid impacts of AI data centers: Challenges and prospects. arXiv preprint arXiv:2509.07218 (2025).arxiv.org/abs/2509.07218
  4. [4]Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. 2019. Certified Adversarial Robustness via Randomized Smoothing. In Proceedings of the 36th International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 97). PMLR, 1310–1320.arxiv.org/abs/1902.02918
  5. [5]The Smart Grid Interoperability Panel–Smart Grid Cybersecurity Committee. 2014. Guidelines for Smart Grid Cybersecurity. Technical Report NISTIR 7628 Rev. 1. National Institute of Standards and Technology. https://csrc.nist.gov/publications/detail/nistir/7628/rev-1/finalDOI
  6. [6]Zahra Zamanzadeh Darban, Qizhou Wang, Geoffrey I. Webb, Shirui Pan, Charu C. Aggarwal, and Mahsa Salehi. 2025. GENIAS: Generator for Instantiating Anomalies in time Series. arXiv:2502.08262 [cs.LG] https://arxiv.org/abs/2502.08262
  7. [7]Abhimanyu Das, Weihiao Kong, Rajat Sen, and Yichen Zhou. 2024. A decoder-only foundation model for time-series forecasting. In Forty-first International Conference on Machine Learning (ICML).
  8. [8]Datacenters.com Cloud. 2025. Cloud vs. Edge: Where Should AI Training Really Happen? https://www.datacenters.com/news/cloud-vs-edge-where-should-ai-training-really-happen Accessed: April 2026.
  9. [9]Nicholas Etherden, Valeriy Vyatkin, and Math H. J. Bollen. 2016. Virtual Power Plant for Grid Services Using IEC 61850. IEEE Transactions on Industrial Informatics 12, 1 (2016), 437–447.
  10. [10]Federal Energy Regulatory Commission. 2021. Participation of Distributed Energy Resource Aggregations in Markets Operated by Regional Transmission Organizations and Independent System Operators. Federal Register. https://www.federalregister.gov/documents/2021/03/30/2021-06089/participation-of-distributed-energy-resource-aggregations-in-markets-operated-by-regional
  11. [11]Giuseppe Fenza, Mariacristina Gallo, and Vincenzo Loia. 2019. Drift-Aware Methodology for Anomaly Detection in Smart Grid. IEEE Access 7 (2019), 9645–9657. doi:10.1109/ACCESS.2019.2891315
  12. [12]Azul Garza, Cristian Challu, and Max Mergenthaler-Canseco. 2023. TimeGPT-1. arXiv preprint arXiv:2310.03589 (2023).
  13. [13]Ian J. Goodfellow, Jonathan Shlens, and Christian Szegedy. 2015. Explaining and Harnessing Adversarial Examples. arXiv:1412.6572 [stat.ML] https://arxiv.org/abs/1412.6572
  14. [14]IEEE. 2005. IEEE Standard Communication Delivery Time Performance Requirements for Electric Power Substation Automation. IEEE Std 1646-2004 IEEE 1646-2004 (2005), 1–36. doi:10.1109/IEEESTD.2005.95748DOI
  15. [15]Ming Jin, Shiyu Wang, Lingyu Chen, Zhi Xuan Chu, James Y Zhang, Xiaoming Shi, Pin-Yu Chen, Yuxuan Liang, Yuan-Fang Li, Shirui Pan, and Qingsong Wen. 2024. Time-LLM: Time series forecasting by reprogramming large language models. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2310.01728
  16. [16]Rudolph Emil Kalman. 1960. A New Approach to Linear Filtering and Prediction Problems. Journal of Basic Engineering 82, 1 (1960), 35–45. doi:10.1115/1.3662552DOI
  17. [17]Guokun Lai, Weicheng Chang, Yiming Yang, and Hanxiao Liu. 2018. Modeling long-and short-term temporal patterns with deep neural networks. In The 41st international ACM SIGIR conference on research & development in information retrieval. 95–104.arxiv.org/abs/1703.07015
  18. [18]Marc Levy. 2025. Amazon to spend $20B on data centers in Pennsylvania, including one next to a nuclear power plant. The Associated Press (2025). https://apnews.com/article/amazon-data-center-nuclear-power-plant-pennsylvania-electricity-grid-31f705d035069279b70fa27a5dc71596
  19. [19]Fuqiang Liu, Sicong Jiang, Luis Miranda-Moreno, Seongjin Choi, and Lijun Sun. 2025. Adversarial Vulnerabilities in Large Language Models for Time Series Forecasting. In The 28th International Conference on Artificial Intelligence and Statistics (AISTATS).arxiv.org/abs/2412.08099
  20. [20]Fan Liu, Hao Liu, and Wenzhao Jiang. 2022. Practical adversarial attacks on spatiotemporal traffic forecasting models. Advances in Neural Information Processing Systems 35 (2022), 19035–19047.
  21. [21]Fei Tony Liu, Kai Ming Ting, and Zhi-Hua Zhou. 2008. Isolation Forest. In Proceedings of the 8th IEEE International Conference on Data Mining (ICDM). 413–422. doi:10.1109/ICDM.2008.17DOI
  22. [22]Jie Lu, Anjin Liu, Fan Dong, Feng Gu, Joao Gama, and Guangquan Zhang. 2019. Learning under Concept Drift: A Review. IEEE Transactions on Knowledge and Data Engineering 31, 12 (2019), 2346–2363. doi:10.1109/TKDE.2018.2876857DOI
  23. [23]Hua Ma, Ruoxi Sun, Minhui Xue, Xingliang Yuan, Carsten Rudolph, Surya Nepal, and Ling Liu. 2025. Keep the Lights On, Keep the Lengths in Check: Plug-In Adversarial Detection for Time-Series LLMs in Energy Forecasting. arXiv:2512.12154 [cs.LG] https://arxiv.org/abs/2512.12154
  24. [24]Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. 2017. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083 (2017).
  25. [25]Yu A Malkov and Dmitry A Yashunin. 2018. Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. IEEE transactions on pattern analysis and machine intelligence 42, 4 (2018), 824–836.
  26. [26]Jowi Morales. 2026. Meta inks deals to supply a staggering 6 gigawatts in nuclear power for data center ambitions – enough wattage to supply 5 million homes. Tom’s Hardware (2026). https://www.tomshardware.com/tech-industry/artificial-intelligence/meta-inks-deals-to-supply-a-staggering-6-gigawatts-in-nuclear-power-for-data-center-ambitions-enough-wattage-to-supply-5-million-homes
  27. [27]Rob Mulla. 2018. Hourly Energy Consumption. https://www.kaggle.com/datasets/robikscube/hourly-energy-consumption Accessed: 2025-10-26.
  28. [28]Dana Nickel and Maggie Miller. 2026. Iranian hackers are targeting US energy and water sectors, federal agencies warn. Politico (2026). https://www.politico.com/news/2026/04/07/iranian-hackers-energy-water-cybersecurity-0862018
  29. [29]Yuqi Nie, Nam H. Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. 2023. A Time Series is Worth 64 Words: Long-term Forecasting with Transformers. In International Conference on Learning Representations.arxiv.org/abs/2211.14730
  30. [30]Izaskun Oregi, Javier Del Ser, Aritz Perez, and Jose A Lozano. 2018. Adversarial sample crafting for time series classification with elastic similarity measures. In International Symposium on Intelligent and Distributed Computing. Springer, 26–39.DOI
  31. [31]Leslie Rice, Eric Wong, and J. Zico Kolter. 2020. Overfitting in adversarially robust deep learning. In Proceedings of the 37th International Conference on Machine Learning (ICML ’20). JMLR.org, Article 749, 12 pages.arxiv.org/abs/2002.11569
  32. [32]Nam News Room. 2025. Tech Firms Are Building Their Own Power Plants. National Association of Manufacturers (2025). https://nam.org/tech-firms-are-building-their-own-power-plants-34960/
  33. [33]Sena Sahin, Burak Sahin, Robin Berthier, Kate Davis, Saman Zonouz, and Frank L. 2025. The Challenges and Opportunities with Cybersecurity Regulations: A Case Study of the US Electric Power Sector. In Proceedings of the 32nd ACM Conference on Computer and Communications Security (CCS).DOI
  34. [34]David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. 2020. DeepAR: Probabilistic forecasting with autoregressive recurrent networks. International journal of Forecasting 36, 3 (2020), 1181–1191. doi:10.1016/j.ijforecast.2019.07.001DOI
  35. [35]Abraham Savitzky and Marcel J. E. Golay. 1964. Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Analytical Chemistry 36, 8 (1964), 1627–1639. doi:10.1021/ac60214a047DOI
  36. [36]Bernhard Schölkopf, John C. Platt, John Shawe-Taylor, Alexander J. Smola, and Robert C. Williamson. 2001. Estimating the Support of a High-Dimensional Distribution. Neural Computation 13, 7 (2001), 1443–1471. doi:10.1162/089976601750264965DOI
  37. [37]John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347 (2017).arxiv.org/abs/1707.06347
  38. [38]Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Yang Wu, et al. 2024. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300 (2024).arxiv.org/abs/2402.03300
  39. [39]Comanita Stefan. 2025. Hourly Electricity Consumption and Production. https://www.kaggle.com/datasets/stefancomanita/hourly-electricity-consumption-and-production Accessed: 2025-06-26.
  40. [40]Artur Trindade. 2015. ElectricityLoadDiagrams20112014. doi:10.24432/C58C86DOI
  41. [41]Eric Wagner, Lennart Bader, Konrad Wolsing, and Martin Serror. 2025. Sherlock: A Dataset for Process-aware Intrusion Detection Research on Power Grid Networks: Dataset Paper. In Proceedings of the Fifteenth ACM Conference on Data and Application Security and Privacy. 419–424. https://doi.org/10.1145/3714393.3726006
  42. [42]Chaojian Yu, Bo Han, Li Shen, Jun Yu, Chen Gong, Mingming Gong, and Tongliang Liu. 2022. Understanding Robust Overfitting of Adversarial Training and Beyond. In Proceedings of the 39th International Conference on Machine Learning.arxiv.org/abs/2206.08675
  43. [43]Jiawen Zhang, Zhenwei Zhang, Shun Zheng, Xuemeng Wen, Jia Li, and Jiang Bian. 2025. Are Time-Series Foundation Models Deployment-Ready? A Systematic Study of Adversarial Robustness Across Domains. arXiv:2505.19397 [cs.LG] https://arxiv.org/abs/2505.19397
  44. [44]Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wanxie Zhang. 2021. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI conference on artificial intelligence, Vol. 35. 11106–11115.arxiv.org/abs/2012.07436

Paper details

vlnc:W_8rrucfj3
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 16

downloads · 2

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents