Abstract
Transient Stability Analysis (TSA) is essential for maintaining power grid synchronization following disturbances. Traditional Time-Domain Simulation (TDS) methods, while accurate, are computationally intensive and unsuitable for real-time applications. Existing machine learning approaches often suffer from architectural rigidity and poor generalization to unseen grid topologies. This paper introduces TSA-LLM, a framework that adapts pre-trained Large Language Models (LLMs) to power system dynamics. By treating grid oscillations as a sequence modeling task, TSA-LLM achieves "universality," demonstrating the ability to generalize to new systems and complex fault scenarios with minimal retraining.
Introduction
The power grid's stability depends on synchronous generators remaining in step after disturbances like line failures or lightning strikes. While deep learning models such as LSTMs and Graph Neural Networks offer speed advantages over TDS, they are typically "one-trick ponies" tied to specific grid layouts. These models face three primary bottlenecks: data rigidity (fixed input dimensions), architectural constraints (difficulty with long-term dependencies), and error propagation in iterative forecasting. TSA-LLM addresses these by reframing multi-variate grid dynamics as a univariate generative sequence task, leveraging the sequence-processing power of transformer backbones.
Methodology: The TSA-LLM Framework
TSA-LLM utilizes a pre-trained GPT backbone (124M parameters) through a "freeze-and-finetune" strategy. The core transformer blocks remain frozen to preserve learned sequence patterns, while only 0.69% of the parameters (input/output layers) are fine-tuned for the power system domain.
Data Pipeline and Attention Mechanisms
The framework employs two key data processing techniques:
- Channel Independence: Grid variables (e.g., rotor angles) are decoupled into independent streams, making the model agnostic to the number of generators.
- Temporal Patching: Time points are grouped into "patches" or tokens, allowing the model to capture local temporal patterns.
Unlike bidirectional models that require the entire sequence, TSA-LLM uses causal attention, ensuring predictions are based solely on past and present states. This mimics real-world online monitoring requirements.
Two-Stage Fine-Tuning
To mitigate error accumulation, the model undergoes a two-stage training process:
- Stage 1 (Teacher Forcing): The model learns basic dynamics using ground-truth data.
- Stage 2 (Scheduled Sampling): The model is gradually transitioned to rely on its own previous predictions, fostering self-correction capabilities.
Experimental Results
The framework was evaluated on the New England 39-bus system and a modified Iceland 189-bus system featuring 20% renewable energy.
Universality and Zero-Shot Generalization
TSA-LLM demonstrates remarkable "universality." When trained on simple N-1 faults, it successfully predicts complex N-2 and N-3 contingencies it has never encountered. As shown in the comparison below, TSA-LLM is the only model that maintains performance across stable/unstable operating conditions (OCs), unseen faults, and heterogeneous systems within a single model architecture.
Performance Metrics
- Accuracy: TSA-LLM reduced Mean Squared Error (MSE) by 84% to 97% compared to state-of-the-art baselines like DNR and LSTM in unstable scenarios.
- Efficiency: The model achieved a 96.88% inference speedup over traditional TDS methods.
- Data Requirements: On the Iceland system, the model matched expert-level performance using only 5% of the available training data.
Conclusion
TSA-LLM proves that Large Language Models are modality-agnostic; the structural alignments learned from human language can be effectively transferred to the physics of power systems. By decomposing complex grid states into independent sequences and utilizing causal attention, the framework provides a scalable, real-time solution for universal transient stability analysis. Future work will explore the model's resilience to sensor noise and its integration with broader "Foundation Models" for energy systems.
Summary updated