Large Language Model Powered Automated Modeling and Optimization of Active Distribution Network Dispatch Problems

Xu Yang, Chenhui Lin, Yue Yang, Qi Wang, Haotian Liu, Haizhou Hua, Wenchuan WuarXiv 2025 · DOI

Introduction

The transition toward Active Distribution Networks (ADNs) has introduced a significant volume of distributed energy resources (DERs), such as solar photovoltaics, battery energy storage systems, and electric vehicles. Efficiently managing these resources through "dispatch"—the calculation of optimal power flows to ensure grid safety and efficiency—is a critical yet complex task. Traditionally, this process requires specialized expertise in power system modeling, optimization theory, and programming, creating a barrier for new market participants like community aggregators or virtual power plant managers.

The Multi-Agent Framework

To bridge this expertise gap, this research introduces a multi-agent Large Language Model (LLM) framework designed to automate the ADN dispatch pipeline. The architecture mimics a human expert team by decomposing the problem into three distinct roles:

  1. Information Extractor (Expert Analyst): Distills natural language queries into structured data schemas (e.g., identifying districts, objectives, and equipment).
  2. Problem Formulator (Mathematician): Constructs formal mathematical models incrementally through a multi-round dialogue method.
  3. Code Programmer (Software Engineer): Translates mathematical models into executable Python code using the PyOptInterface library, supported by Retrieval-Augmented Generation (RAG).
The multi-agent LLM framework for automated ADN dispatch.

Incremental Modeling via Multi-Round Dialogue

A core challenge for LLMs in engineering tasks is the tendency to "hallucinate" or lose logical coherence when attempting to solve complex mathematical problems in a single step. To mitigate this, the framework employs a multi-round dialogue method for the Problem Formulator.

Instead of generating a complete optimization model at once, the agent builds the model through sequential stages: defining the objective function, establishing power flow constraints, and finally incorporating specific equipment constraints. This structured approach ensures that each component of the model is verified before proceeding, significantly increasing the reliability of the final output.

Multi-round dialogue strategy for structured mathematical modeling.

Implementation and Results

The system was evaluated using standard IEEE 33-bus, 69-bus, and 141-bus distribution systems against a benchmark of 30 diverse natural language dispatch requests. The "Full" method, incorporating all three agents and RAG-enhanced programming, achieved a pass@3 rate of 100%, successfully producing executable and correct code for every test case.

In a practical demonstration on a valley district test case, the LLM-generated dispatch strategy reduced power loss by 12.6% (from 3.34MWh to 2.92MWh) while maintaining all bus voltages within safe operational limits. Ablation studies confirmed that removing the specialized Information Extractor or the multi-round Formulator led to a significant increase in modeling errors, underscoring the necessity of the multi-agent decomposition.

Conclusion and Future Directions

This framework demonstrates that LLMs can effectively automate complex power system engineering tasks when guided by structured, multi-agent workflows. While the current system handles common DERs with high reliability, future work will focus on reducing computational latency for real-time applications and integrating automated formal verification to ensure absolute physical safety in zero-failure grid environments.

Summary updated

BibTeX
@misc{yang2025large,
  author = {Xu Yang and Chenhui Lin and Yue Yang and Qi Wang and Haotian Liu and Haizhou Hua and Wenchuan Wu},
  title = {{Large Language Model Powered Automated Modeling and Optimization of Active Distribution Network Dispatch Problems}},
  year = {2025},
  eprint = {2507.21162},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.21162},
}
Figure