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

Zewei Shi, Ruoxi Sun, Minhui Xue, Feng Liu, Hua Ma, Xingliang Yuan, Surya NepalarXiv 2026 · arXiv

TL;DR

Researchers have developed a hierarchical, multi-agent defense framework to protect energy grids from adversarial attacks targeting AI-based demand forecasting. By combining Multi-Agent Reinforcement Learning (MARL) for detection, wavelet-based signal repair for continuity, and LLM-driven forensic auditing, the system achieves high accuracy (F1 > 0.91) and stays well within the strict 16ms latency requirements of critical infrastructure.

What Problem Does This Paper Address?

Modern energy infrastructure is increasingly reliant on Time-Series Large Language Models (TS-LLMs) for electricity-demand forecasting. While these models are powerful, they are highly vulnerable to adversarial attacks—maliciously crafted sensor inputs designed to trick the AI into making wrong predictions. Such errors can lead to disastrous real-world consequences, like unnecessary load shedding or erroneous market orders.

The challenge is three-fold:

  1. Data Drift: Legitimate changes (like a heatwave) can look like attacks, leading to false alarms.
  2. Latency: Grid control systems operate on razor-thin time budgets (often <16ms).
  3. Auditability: When something goes wrong, human operators need clear, evidence-based reports to understand if they are under attack.

Existing defenses often focus only on the "edge" (the sensors) and fail to address the complex, multi-layered nature of the grid.

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

Methods

The authors propose a three-layer conceptual model (L1: End Devices, L2: Local Centers, L3: Virtual Power Plants) and a corresponding hierarchical defense:

  • Cooperative MARL Detection (L2): Instead of one giant model, the system uses six "specialist" agents. Each agent monitors a specific feature family (e.g., temporal patterns, prediction statistics, or entropy). A coordinator agent then fuses these signals using Reinforcement Learning (PPO or GRPO) to decide if an input is adversarial. Crucially, the underlying TS-LLM remains "frozen"—the defense acts as a lightweight wrapper.
  • DWT-Based Signal Repair (L2): If an input is flagged as an attack, the system doesn't just drop it (which would break the forecast). Instead, it uses a Discrete Wavelet Transform (DWT) to "clean" the signal. It retrieves a similar historical clean window from the same user and uses it to calibrate thresholds that suppress high-frequency adversarial noise while keeping the underlying demand trend.
  • LLM Forensic Auditing (L3): At the Virtual Power Plant (VPP) level, where auditing is critical but logs are massive, the authors deploy an LLM agent (Claude Code). This agent correlates Operational Technology (OT) logs across devices to reconstruct attack narratives, providing human-in-the-loop auditors with grounded evidence.

Datasets

The framework was evaluated using several real-world and benchmark datasets:

  • NI & HECP: Regional hourly electricity consumption datasets from PJM (USA) and Romania.
  • Electricity: User-level consumption records for 321 clients.
  • Sherlock: A specialized benchmark for process-aware intrusion detection in power grids, used to test the auditing agent.
  • Attacks: The models were tested against DGA (gradient-free queries) and GenIAS (generative anomaly synthesis) attacks.

Key Insights and Ideas

  • Detection is not enough; repair is mandatory. In a power grid, you can't just stop the data flow because you suspect an attack. The DWT-based repair ensures "forecast continuity," allowing the system to keep running even while under fire.
  • Context-Awareness via MARL: By using specialists for different feature types, the MARL detector can distinguish between a malicious attack and "benign drift" (like a sudden change in weather) that might confuse a simpler anomaly detector.
  • The "Knowledge Gap" in Auditing: One of the biggest hurdles in grid security is that auditors often lack deep OT-domain knowledge. Using an LLM to "reason" through logs and cite specific evidence (timestamps, device IDs) significantly reduces the human burden.

Key Results

The system demonstrated impressive performance across the board:

  • Detection Accuracy: The best configuration (GRPO + TimeLLM) achieved an F1 score above 0.91 across all dataset-attack pairs, significantly outperforming commercial baselines like TimeGPT's native anomaly detection.
Table 1: The performance of adversarial detection.
  • Signal Recovery: The DWT repair module reduced the Relative Squared Error (RSE) of adversarial inputs by up to 83%.
  • Real-Time Performance: The entire detection-and-repair pipeline averaged just 7.95 ms, with a worst-case latency of 14.50 ms—comfortably meeting the IEEE 1646 16ms requirement.
  • Auditing: The few-shot LLM auditor detected 77.78% of attacks in the Sherlock dataset, including 100% of the critical "Industroyer-class" incidents.
Table 7: Audit evaluation on 18 attack windows and 180 be- nign windows spanning 30 days.

Limitations and Future Work

  • Historical Dependency: The signal repair module relies on having a representative "clean" history for a user. If a user is entirely new or their behavior changes radically and permanently, the repair quality may degrade.
  • Human-in-the-Loop: While the LLM auditor is powerful, it is designed as a filter, not an autonomous actor. Final authority still rests with humans, which could be a bottleneck during a massive, multi-vector attack.
  • Future Directions: The authors suggest exploring more adaptive "confidence gates" for repair and extending the framework to handle multi-variate time series beyond just electricity demand.

Summary updated

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.
BibTeX
@misc{shi2026detect,
  author = {Zewei Shi and Ruoxi Sun and Minhui Xue and Feng Liu and Hua Ma and Xingliang Yuan and Surya Nepal},
  title = {{Detect, Repair and Audit: A Hierarchical Multi-Agent Defense Against Adversarial Attacks in Energy Forecasting}},
  year = {2026},
  eprint = {2611.02310},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.02310},
}
Figure