Table of Contents
Fetching ...

LLM4DistReconfig: A Fine-tuned Large Language Model for Power Distribution Network Reconfiguration

Panayiotis Christou, Md. Zahidul Islam, Yuzhang Lin, Jingwei Xiong

TL;DR

The paper presents LLM4DistReconfig, a fine-tuned large language model approach for power distribution network reconfiguration that leverages domain-specific prompts and a custom loss to enforce radial, cycle-free, and feasible configurations. It demonstrates near real-time inference and strong generalization to unseen networks by training on synthetic MATPOWER-based datasets across multiple IEEE feeders, and shows substantial reductions in invalid outputs while maintaining accurate voltage and loss estimates. Key contributions include a ChatML-formatted dataset, a penalty-based loss (cycle, subgraph, suboptimal) integrated with standard training loss, and open-source code. The work highlights the potential of task-tailored LLMs to complement traditional optimization methods in complex, safety-critical power systems, while outlining limitations and avenues for future enhancements such as unbalanced networks and improved parsing.

Abstract

Power distribution networks are evolving due to the integration of DERs and increased customer participation. To maintain optimal operation, minimize losses, and meet varying load demands, frequent network reconfiguration is necessary. Traditionally, the reconfiguration task relies on optimization software and expert operators, but as systems grow more complex, faster and more adaptive solutions are required without expert intervention. Data-driven reconfiguration is gaining traction for its accuracy, speed, and robustness against incomplete network data. LLMs, with their ability to capture complex patterns, offer a promising approach for efficient and responsive network reconfiguration in evolving complex power networks. In this work, we introduce LLM4DistReconfig, a deep learning-based approach utilizing a fine-tuned LLM to solve the distribution network reconfiguration problem. By carefully crafting prompts and designing a custom loss function, we train the LLM with inputs representing network parameters such as buses, available lines, open lines, node voltages, and system loss. The model then predicts optimal reconfigurations by outputting updated network configurations that minimize system loss while meeting operational constraints. Our approach significantly reduces inference time compared to classical algorithms, allowing for near real-time optimal reconfiguration after training. Experimental results show that our method generates optimal configurations minimizing system loss for five individual and a combined test dataset. It also produces minimal invalid edges, no cycles, or subgraphs across all datasets, fulfilling domain-specific needs. Additionally, the generated responses contain less than 5% improper outputs on seen networks and satisfactory results on unseen networks, demonstrating its effectiveness and reliability for the reconfiguration task.

LLM4DistReconfig: A Fine-tuned Large Language Model for Power Distribution Network Reconfiguration

TL;DR

The paper presents LLM4DistReconfig, a fine-tuned large language model approach for power distribution network reconfiguration that leverages domain-specific prompts and a custom loss to enforce radial, cycle-free, and feasible configurations. It demonstrates near real-time inference and strong generalization to unseen networks by training on synthetic MATPOWER-based datasets across multiple IEEE feeders, and shows substantial reductions in invalid outputs while maintaining accurate voltage and loss estimates. Key contributions include a ChatML-formatted dataset, a penalty-based loss (cycle, subgraph, suboptimal) integrated with standard training loss, and open-source code. The work highlights the potential of task-tailored LLMs to complement traditional optimization methods in complex, safety-critical power systems, while outlining limitations and avenues for future enhancements such as unbalanced networks and improved parsing.

Abstract

Power distribution networks are evolving due to the integration of DERs and increased customer participation. To maintain optimal operation, minimize losses, and meet varying load demands, frequent network reconfiguration is necessary. Traditionally, the reconfiguration task relies on optimization software and expert operators, but as systems grow more complex, faster and more adaptive solutions are required without expert intervention. Data-driven reconfiguration is gaining traction for its accuracy, speed, and robustness against incomplete network data. LLMs, with their ability to capture complex patterns, offer a promising approach for efficient and responsive network reconfiguration in evolving complex power networks. In this work, we introduce LLM4DistReconfig, a deep learning-based approach utilizing a fine-tuned LLM to solve the distribution network reconfiguration problem. By carefully crafting prompts and designing a custom loss function, we train the LLM with inputs representing network parameters such as buses, available lines, open lines, node voltages, and system loss. The model then predicts optimal reconfigurations by outputting updated network configurations that minimize system loss while meeting operational constraints. Our approach significantly reduces inference time compared to classical algorithms, allowing for near real-time optimal reconfiguration after training. Experimental results show that our method generates optimal configurations minimizing system loss for five individual and a combined test dataset. It also produces minimal invalid edges, no cycles, or subgraphs across all datasets, fulfilling domain-specific needs. Additionally, the generated responses contain less than 5% improper outputs on seen networks and satisfactory results on unseen networks, demonstrating its effectiveness and reliability for the reconfiguration task.
Paper Structure (41 sections, 11 equations, 9 figures, 13 tables)

This paper contains 41 sections, 11 equations, 9 figures, 13 tables.

Figures (9)

  • Figure 1: Process of Dataset Generation for Fine-Tuning the LLM
  • Figure 2: Full Training Pipeline Diagram
  • Figure 3: Training & Inference Diagram
  • Figure 4: Comparison of fine-tuned LLaMA-2 models on generating improper responses, illustrating the impact of the custom loss function, augmented prompts, and training epochs on model performance.
  • Figure 5: Network configuration: (a) without and (b) with the custom loss function.
  • ...and 4 more figures