Detection, Repair, and Auditing: Hierarchical Multi-Agent Defense for Adversarial Attacks on Energy ForecastingDetect, Repair and Audit: A Hierarchical Multi-Agent Defense Against Adversarial Attacks in Energy Forecasting
The authors propose a hierarchical multi-agent defense for energy forecasting: L2 uses MARL detection plus DWT repair, and L3 uses LLM auditing; the authors state that the best configuration exceeds 0.91 F1.
At L1/L2, the attacker has only black-box query access to the TS-LLM predictor, can partially compromise some telemetry or OT endpoints, and knows that the defense mechanism exists and its algorithmic logic but not the calibration parameters; the defender cannot modify the frozen TS-LLM and has no online ground-truth labels.
- TS-LLMs used for energy demand forecasting are vulnerable to tampered sensor inputs; existing defenses cover only end-device forecasting and ignore the differing requirements of each layer regarding data drift, latency, and auditing.
- A three-layer model distilled from energy standards; L2 deploys a cooperative MARL detector (six experts plus a coordinator) and DWT signal repair, and L3 deploys an evidence-grounded, human-in-the-loop LLM audit agent.
- The authors report: GRPO+TimeLLM detection F1 exceeds 0.91 on all dataset–attack pairs; DWT repair reduces input RSE by up to 83.36%; the few-shot audit agent detects 14/18 attack windows on Sherlock; and the average end-to-end latency is 7.95 ms.
- The authors note that repair depends on representative history from the same user, and unseen operating conditions may lack suitable references; the audit evaluation includes only 18 attack windows plus 180 benign windows, and recall drops to 66.7% when logs are truncated by 25%.
- Evaluated models
- TimesFM-2.5TimeLLMClaude Code
- Benchmarks
- NIHECPElectricitySherlock
- Metrics
- F1PrecisionRecallFPRAUPRCRSE ReductionHarmLatency
The researchers propose a hierarchical multi-agent defense framework for energy forecasting, addressing the problem that TS-LLM is susceptible to tampered sensor inputs: a local control center uses MARL to detect and repair signals, and an auditing VPP uses an LLM auditing agent with human-in-the-loop verification. The best MARL configuration exceeds 0.91 F1 across dataset-attack combinations, and signal repair reduces RSE by up to 83%; the few-shot auditor detects 77.78% of attacks on Sherlock.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:智能体安全边界在签名、授权与上下文
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:智能体的安全边界在签名、授权与上下文三层防线里
Detect, Repair and Audit: A Hierarchical Multi-Agent Defense Against Adversarial Attacks in Energy Forecasting(https://arxiv.org/abs/2611.02310)
Paper analysis
What problem does this paper attempt to solve?
Energy forecasting TS-LLMs are threatened by adversarial inputs, and the authors state that existing defenses overlook the layered requirements for data drift, latency, and auditing.
Core problem: TS-LLMs for energy demand forecasting are vulnerable under tampered sensor inputs, while existing defenses cover only endpoint-device forecasting and overlook the differing data drift, latency, and auditing requirements of each layer of energy infrastructure.
- Scenario and importance: electricity demand forecasting guides supply dispatch, resource allocation, and market operations; the authors cite events such as the 2016 outage caused by Industroyer malware to show that energy infrastructure security is related to AI service continuity.
- Shortcomings of existing methods: the authors state that adversarial training is costly for large TS-LLMs and prone to overfitting to known attack distributions; the guarantees of randomized smoothing depend on a specific perturbation model; anomaly detectors and signal filters must tolerate benign distribution drift; and detection without repair interrupts forecasting continuity.
- Core observation: the authors distill a three-layer conceptual model from standards such as IEC 61850, the NIST smart grid guidelines, and FERC Order 2222—end devices (L1), local control center (L2), and virtual power plant (VPP, L3)—each with different computation, latency, and auditing constraints (Figure 1).
- Proposed approach: deploy a cooperative MARL detector plus DWT signal repair at L2, and an evidence-grounded, human-in-the-loop (HITL) LLM audit agent at L3, linked by cross-layer evidence contracts.
- Threat model (§3):
- Attacker goals: at L1, inject perturbed readings so that forecasts deviate from the operational tolerance band; at L2, distort forecasts through input manipulation, possibly using gradual distribution shift to evade detection; at L3, flood the audit pipeline, forge logs, or perform OT-level command manipulation.
- Knowledge: at L1/L2, only black-box access to the running TS-LLM predictor, with no visibility into parameters, gradients, or clean training data.
- Capability: partial compromise—control or impersonate some telemetry or OT communication endpoints, but without gaining administrative control of the forecasting pipeline or the VPP; knows that the defense mechanism exists and its algorithmic logic, but not the specific calibration parameters.
- Victim system and defense constraints: a frozen pretrained TS-LLM (the defender cannot change the architecture or weights), with no online ground-truth labels.
What related research exists?
Related work is divided into three groups: forecasting models and input-side attacks, forecasting integrity defenses, and audit governance; baselines include TimeGPT native anomaly detection and others.
Forecasting models and input-side attacks
- Time-series forecasting models: from statistical methods (ARIMA, exponential smoothing) to neural models (DeepAR, LSTNet) and Transformers (Informer, PatchTST), and then to TS-LLMs with zero/few-shot capability; this paper selects TimeGPT, TimesFM, and TimeLLM to cover three designs.
- Gradient attacks: FGSM/BIM and PGD have been extended to time-series classification and graph forecasting.
- Attacks against LLM forecasters: DGA (2025) generates small perturbations through gradient-free model queries to mislead forecasts; GenIAS (2025), originally an anomaly generation method, synthesizes realistic anomaly sequences through latent-space perturbations. This paper uses these two to generate adversarial samples.
Forecasting integrity defenses
- Ma et al. (2025): detects adversarial TS-LLM inputs through sampling-induced divergence, checking forecast consistency across shortened input variants; the paper notes that such detection mechanisms do not provide a method for repairing adversarial perturbed inputs.
- TimeGPT: a native anomaly detection interface that flags observations falling outside the forecast interval; it likewise only gives anomaly signals and does not repair.
Audit governance
- Sahin et al. (2025): studies NERC-CIP compliance in the US electric power industry and finds a heavy evidence-preparation burden, insufficient auditor OT domain knowledge, and a one-size-fits-all audit process; the paper notes that this work characterizes governance and audit practice challenges, not algorithmic mechanisms for detecting OT attacks from device logs.
Baselines and benchmarks: the detection baseline is the TimeGPT native anomaly detection endpoint; the coordination policy baselines are Majority Vote, Weighted Vote, Logistic Regression, Random Forest, XGBoost, and Supervised MLP; the repair baselines are Savitzky–Golay, Kalman Smoother, and Fixed DWT; the audit baselines are rule-based signatures, single-pass LLM, and plan-mode zero-shot. The datasets are NI, HECP, Electricity, and Sherlock.
The authors position this paper as: a framework that simultaneously provides detection, input recovery, and forensic auditing under distribution drift and hierarchical operational constraints, whereas the above works each cover only part of it.
How does the paper address this problem?
Layered defense: L2 uses six-expert cooperative MARL detection plus reference-calibrated DWT repair, and L3 uses four-stage evidence-grounded LLM auditing.
The overall approach deploys defenses hierarchically across three layers: the L2 cooperative MARL detector screens input windows, the DWT repair module recovers rejected signals to maintain forecast continuity, and the L3 LLM audit agent correlates OT logs to assist manual forensics, with cross-layer evidence contracts ensuring traceability.
Problem setting and formalization
- Three-layer model: L1 end devices (smart meters, IoT sensors), L2 local center (runs TS-LLM forecasting), L3 VPP (market decisions and auditing); the design requires that, because of R1's compute constraints, detection and repair are concentrated at L2, that R2 must meet the IEEE 1646 16 ms latency budget and tolerate benign drift, and that R3 requires scalable forensic auditing.
- Repair objective: minimize the relative squared error between the repaired sample and the clean sample, RSE(Z, Xclean) = (∑i (Xclean(i) − Z(i))2)/(∑i (Xclean(i) − X̄clean)2), i.e., the degree of distortion relative to the clean baseline.
MARL detector (§4.1)
- Input preprocessing: the full context is split in time into an internal context and internal ground truth, zero-padded at the front, and fed into the same frozen TS-LLM to obtain internal forecasts, so that comparison features can be constructed without future observations; there are six preprocessing streams in total.
- Six experts plus coordinator: a 100-dimensional feature vector is constructed from the six streams (10 dimensions for time, 31+31 for forecast statistics, 12 for entropy, 16 for error/relational metrics, Appendix B), and the sixth observation is forecasting-model knowledge (projection head plus decision tree); each expert outputs an adversarial confidence, and the coordinator concatenates the six confidences with the decision-tree depth into a joint state st = [pt1, ..., pt6, dt] ∈ ℝ7 and outputs a binary action (accept/reject).
- Decision-tree mechanism (Algorithm 1): first the projection head scores; below 0.5 it is directly judged benign (depth 0); otherwise a DWT smoothing probe is used (depth 1); if still suspicious, an odd/even subsequence split test is performed (depth 2).
- Training: the six experts and the coordinator are jointly trained with a shared team reward (PPO or GRPO, learning rate 10⁻³); the reward has four terms: accuracy gain, missed-detection penalty, false-positive penalty, and latency penalty; the TS-LLM backbone is frozen and receives no ground-truth labels at deployment; a rolling trusted-context buffer is updated with accept/repair decisions.
DWT signal repair (§4.2)
- Fixed parts: four-level (J=4) DWT; the wavelet family is selected once per dataset from the clean training set, and the mixing ratio is calibrated on the user's clean history.
- Per-window adaptation: for a rejected window, HNSW approximate nearest-neighbor search retrieves the reference with the closest RSE from the same user's clean reference pool (up to 10,000 sliding windows), and only the per-level soft-threshold multipliers are calibrated per window before mixing with the real-time input.
- Reference confidence gate: repair is performed only when the RSE between the rejected window and the reference does not exceed a user-specific threshold; otherwise it abstains and falls back to a persistence forecast; the authors state that the gate screens for reference mismatch rather than guaranteeing repair safety.
LLM audit agent and cross-layer contract (§4.3, §4.4)
- Four-stage process: input ingestion (OT log window plus runtime candidate attack set) → cross-device, cross-time-window reasoning and correlation (attack hypotheses are restricted to the candidate set) → evidence-grounded report (each anomaly flag must cite a specific log entry) → escalation output (structured report; if unsupported, return an empty anomaly list).
- Human in the loop: the agent performs only forensic filtering and cannot autonomously execute repair actions; final verification and control rest with the human auditor.
- Evidence contract: each input window is assigned an event identifier and hash; L2 records expert confidences, actions, and repair parameters; L3 appends net-load bids and operations; the same event identifier runs through the records of all three layers.
What experiments did the paper conduct?
Detection and repair were measured on three datasets under two attacks, and auditing was measured on Sherlock; the authors report that the best configuration exceeds F1 0.91 and that repair reduces RSE by up to 83.36%.
Experimental Setup
- Backbones under test: TimesFM-2.5 and TimeLLM (LLaMA backend) as frozen forecasting backbones, each with two MARL configurations, PPO/GRPO; the TimeGPT-1.0 native anomaly detection endpoint serves as an independent baseline.
- Datasets: NI (12 PJM regions, over 10 years), HECP (Romania, 6.5 years), Electricity (UCI preprocessed, 40 of 321 customers selected, 32 training/8 test); sliding window length 256, step 48; NI/HECP split 80/20 by time.
- Attacks: DGA and GenIAS generate adversarial samples, with clean/adversarial labeled 0/1; the Electricity test set contains 4,336 clean windows and 8,672 labeled samples per attack.
- Metrics: detection uses F1, Precision, Recall, FPR, AUPRC; repair uses input-space and prediction-space RSE reduction, clean distortion, harm (the proportion of samples whose post-repair prediction error increases by more than 1%), and latency.
- Audit evaluation: Sherlock benchmark (generated by the Wattson simulator, over 30 days of grid behavior), with the basic test set used for zero/few-shot and the semi-urban set providing few-shot examples; the agent is Claude Code, run in plan mode; 18 attack windows plus 180 benign windows.
- Number of repetitions: the audit robustness experiment was run three times (Table 8 reports mean±standard deviation); the paper does not report the number of repetitions for the detection and repair experiments.
Main Results
Detection F1 (according to Table 1):
Swipe horizontally to read the table
Attack Dataset TimesFM+PPO TimesFM+GRPO TimeLLM+PPO TimeLLM+GRPO TimeGPT (Native AD) DGA NI 0.9124 0.9375 0.9144 0.9923 0.1536 DGA HECP 0.7867 0.7778 0.7778 0.9911 0.3156 DGA Electricity 0.7866 0.7882 0.8721 0.9198 0.2312 GenIAS NI 0.9859 0.9918 0.9898 0.9996 0.2527 GenIAS HECP 0.9778 0.9822 0.9778 1.0000 0.1622 GenIAS Electricity 0.9137 0.9458 0.9195 0.9841 0.3149 - The authors state that the best configuration, GRPO+TimeLLM, exceeds F1 0.91 on every dataset–attack pair, and that all four MARL configurations outperform the TimeGPT native anomaly detection baseline on all pairs.
- Exception: TimeLLM's advantage is not consistent across optimizers—on the HECP dataset under the DGA attack, PPO+TimeLLM is 0.7778, slightly below PPO+TimesFM's 0.7867.
Coordination Strategy Comparison (§5.2, Table 2)
- What was tested: six non-RL fusion methods and MARL (PPO/GRPO) were compared under the same observations and the same split, as an end-to-end coordination comparison with matched inputs rather than a frozen same-state fusion ablation.
- Results: MARL (GRPO) achieves F1 0.965, FPR 0.022, normalized cost 0.059; the supervised MLP is F1 0.951, FPR 0.034, cost 0.080; Majority Vote is lowest (F1 0.875).
- Authors' interpretation: GRPO reduces FPR from the supervised MLP's 0.034 to 0.022, and reduces normalized running cost from 0.080 to 0.059.
Repair Performance and Robustness (§5.3, §5.4, Table 3–5)
- Input-space repair: DWT repair reduces input RSE under all six dataset–attack settings, by 34.73%–60.74% under DGA and 38.91%–83.36% under GenIAS (Table 3).
- Prediction-space recovery: TimeLLM drops by 39.04%–63.04% under DGA and 39.91%–89.04% under GenIAS; TimesFM is 9.39%–44.75% and 9.70%–22.09% respectively; the authors state that TimeLLM has a larger relative reduction under all six settings.
- Baselines and gating (Table 4): Savitzky–Golay and Kalman smoothing reduce RSE by only 31.6% and 35.8%, with harm 12.7% and 10.8%; adaptive DWT without gating 63.4%, harm 5.4%; with a confidence gate added, 61.8%, harm reduced to 2.1%, and latency increases from 2.32 ms to 2.35 ms. The authors state that per-window threshold adaptation provides the main repair gain, and that gating limits the harm caused by unreliable references.
- Reference pool stress test (Table 5): under the same-user same-season condition, increasing the pool from 100 to 10K raises the RSE reduction from 50.9% to 61.8%; cross-user matching drops to 45.6%, seasonal shift to 42.8%, and rare-event windows to 29.4% (harm 9.7%, coverage 55.1%); with no history, no repair is performed and all metrics are 0.0%. The authors state that these drops stem from reference mismatch rather than additional computation (latency is nearly identical across conditions at 2.34–2.36 ms).
Audit Agent (§5.5, Table 6–8)
- Detection rate: zero-shot detects 9/18 (50%), few-shot detects 14/18 (77.8%); Industroyer rises from 6/7 to 7/7, Control & Freeze from 1/5 to 4/5, Drift-Off stays at 2/4, and ARP Spoofing DoS is only 1/2; the authors state that the improvement from examples is uneven across attack families.
- False-positive trade-off (Table 7): the few-shot evidence-gated configuration has 14 TP/5 FP, precision 73.7%, recall 77.8%, FPR 2.8%, F1 75.7%, and 0.17 false alarms per day; single-pass LLM is 13 TP/16 FP, and rule-based is 11 TP/8 FP; the authors state that 0.17 false alarms per day is still a proxy for review burden rather than a negligible cost.
- Degraded-log sensitivity (Table 8, three runs): 25% truncation lowers recall from 77.8±3.2% to 66.7±3.2% and raises the abstention rate from 4.8% to 17.4%; 10% token noise raises FPR from 2.8±0.6% to 3.5±0.9%; the evidence validity rate for retained markers is 100% under all conditions (only for retained markers that pass parsing).
Other Ablations and Analyses
- Latency (§5.6): the full GRPO+TimeLLM detection-plus-repair pipeline averages 7.95 ms and a worst observed 14.50 ms on AMD Ryzen 9 9950X + RTX 6000 Ada, below the 16 ms budget.
- Coordination strategy latency (Table 2): the MARL (GRPO) 0.059 cost term corresponds to a latency column value of 0.087 (normalized), and the latency column values across methods range from 0.059 to 0.188 (normalized values).
- Repair latency (Table 4): Savitzky–Golay 0.31 ms, Kalman 0.44 ms, Fixed DWT 0.61 ms, adaptive DWT 2.32–2.35 ms.
What are some points that can be further explored?
The authors note that repair depends on representative same-user history; the experiments cover three datasets, two attacks, and an audit evaluation of 18 attack windows.
Limitations and future directions noted by the authors
- Dependence on reference representativeness (§4.2): historical references may not fully capture the current operating context (e.g., weather-driven load, dispatch changes, behavioral differences); the authors state that unseen new operating conditions may lack suitable references, which motivates the confidence gate.
- Capability boundary of the confidence gate (§4.2): the authors state that the gate screens for reference mismatch rather than guaranteeing repair safety.
- Scope of the audit evidence validity rate (§5.5): the 100% evidence-valid reported in Table 8 applies only to retained flags; the authors note that it does not measure the validity rate of the original proposed flags, nor the correctness of attack diagnosis.
- False-positive burden (§5.5): the authors state that 0.17 false positives per day in the few-shot configuration is still a direct proxy for review burden, not a negligible cost.
- Uneven improvement from examples (§5.5): the authors state that few-shot examples improve coverage unevenly across attack families (Drift-Off remains 2/4, ARP Spoofing DoS only 1/2).
Scope of experimental coverage
- The forecasting backbones under test are two open-source models, TimesFM-2.5 and TimeLLM (LLaMA backend), plus the TimeGPT-1.0 native anomaly detection endpoint as a baseline (§5.1, Appendix A).
- Detection and repair evaluation covers three datasets (NI, HECP, Electricity) and two attacks (DGA, GenIAS); audit evaluation is conducted on the Sherlock basic test set, containing 18 attack windows and 180 benign windows (Tables 6, 7).
- Latency numbers come from a single workstation configuration (AMD Ryzen 9 9950X + NVIDIA RTX 6000 Ada); the paper reports mean and worst observed values (§5.6).
- The audit robustness experiment is repeated three times and reports standard deviation (Table 8); the detection and repair experiments do not report the number of repetitions, nor statistical significance tests.
- The audit agent runs with Claude Code in plan mode; the paper does not report the number of MARL training iterations or the query budget.
Summarize the main content of the paper
Layered defense for energy forecasting: MARL detection plus DWT repair guard L2, and evidence-grounded LLM auditing guards L3; the authors report that multiple metrics meet the targets.
A defense paper on energy demand forecasting security that addresses the vulnerability of TS-LLM predictors under tampered inputs and proposes a framework that deploys defenses in layers according to a three-layer infrastructure model.
- Problem: the authors state that existing defenses cover only endpoint-device forecasting and overlook the differing requirements of each layer for data drift, latency (the 16 ms budget of IEEE 1646), and auditing; detection without repair also interrupts forecasting continuity.
- Method: L2 deploys a cooperative MARL detector with six experts plus a coordinator (joint PPO/GRPO training, shared team reward, frozen TS-LLM backbone); rejected windows are handled by a DWT repair module that uses clean references from the same user retrieved via HNSW for per-window threshold calibration, and falls back to a persistence forecast when the confidence gate mismatches; L3 deploys a four-stage LLM audit agent, where anomaly flags must cite specific log entries, with human-in-the-loop final verification.
- Detection results: GRPO+TimeLLM exceeds F1 0.91 on all six combinations of NI/HECP/Electricity × DGA/GenIAS (the highest is 0.9996 for NI+GenIAS), and the TimeGPT native anomaly detection baseline does not exceed 0.3156 on any (Table 1).
- Repair results: input-space RSE drops by 34.73%–60.74% under DGA and 38.91%–83.36% under GenIAS; TimeLLM prediction-space RSE drops by up to 89.04% (Table 3); gated adaptive DWT drops by 61.8% with harm 2.1% on a 10K same-user pool (Table 5).
- Auditing and overhead: the few-shot evidence-gated configuration detects 14/18 attack windows on Sherlock (77.8% recall, 2.8% FPR, Table 7); the average end-to-end latency is 7.95 ms and the worst observed is 14.50 ms, below the 16 ms budget (§5.6).
- Authors' conclusion: the authors state that the framework maintains forecasting continuity under distribution drift and assists human forensics; they also note that repair depends on representative history from the same user, unseen operating conditions may lack suitable references, and audit false positives remain a review burden.