PowerGraph-LLM: Novel Power Grid Graph Embedding and Optimization with Large Language Models
Fabien Bernier, Jun Cao, Maxime Cordy, Salah Ghamizi
TL;DR
PowerGraph-LLM introduces a novel framework that solves AC OPF by querying large language models with hybrid graph and tabular embeddings of power grids. The approach combines a grid-embedding pipeline, context-driven LLM inference, and LoRA-based fine-tuning to adapt off-the-shelf LLMs to OPF tasks. An extensive empirical study shows that model size and fine-tuning improve performance, with graph representations becoming more effective post-tuning and larger LLMs approaching the performance of proprietary models on key metrics. The work demonstrates the potential of LLMs for scalable, data-efficient OPF solutions applicable to realistic grids and complex constraints.
Abstract
Efficiently solving Optimal Power Flow (OPF) problems in power systems is crucial for operational planning and grid management. There is a growing need for scalable algorithms capable of handling the increasing variability, constraints, and uncertainties in modern power networks while providing accurate and fast solutions. To address this, machine learning techniques, particularly Graph Neural Networks (GNNs) have emerged as promising approaches. This letter introduces PowerGraph-LLM, the first framework explicitly designed for solving OPF problems using Large Language Models (LLMs). The proposed approach combines graph and tabular representations of power grids to effectively query LLMs, capturing the complex relationships and constraints in power systems. A new implementation of in-context learning and fine-tuning protocols for LLMs is introduced, tailored specifically for the OPF problem. PowerGraph-LLM demonstrates reliable performances using off-the-shelf LLM. Our study reveals the impact of LLM architecture, size, and fine-tuning and demonstrates our framework's ability to handle realistic grid components and constraints.
