Figure 1. How optimization results become training data: MILP set-points are normalized, written as structured prompts, and used to fine-tune the LLM scheduler.
Source: Energy and Buildings, 2026.
Can a language model take operational decisions for the grid? This project treats fine-tuned and multi-agent large language models as decision-makers for scheduling, dispatch, and control, as scalable generative alternatives to conventional machine-learning surrogates.
In Energy and Buildings we fine-tuned an LLM on optimal set-points generated by a mixed-integer linear program for net-zero energy buildings (distributed generation, storage, grid exchange, heating, and cooling). The fine-tuned model predicts near-optimal schedules without re-solving the optimization, reaching a test MAE of 0.0853 and RMSE of 0.286 and cutting MAE by 88% relative to an ANN and by 80% relative to XGBoost, while the predicted schedules remain operationally feasible.
At IEEE ECCE 2025 we showed that off-the-shelf reasoning LLMs with few-shot prompting solve the lossless economic-dispatch problem on the IEEE 118-bus system without explicit mathematical formulations, labeled data, or training.
Ongoing work, with two manuscripts under review at IEEE Transactions on Smart Grid, uses multi-agent LLMs for decentralized Volt/VAR control and for reliability-oriented clustering of DER-rich active distribution networks.
Figure 2. The net-zero building energy system behind the surrogate scheduler: PV, distributed generation, storage, and thermal devices exchanging power with the utility grid.
Source: Energy and Buildings, 2026.
Journal article · Energy and Buildings, vol. 364, 117588, 2026
Abstract
Buildings account for a substantial share of global energy consumption and associated carbon emissions, which has increased interest in net-zero energy buildings (NZEBs) and their efficient operation. In NZEB energy management, operational scheduling must coordinate distributed generation (DG), energy storage systems (ESSs), utility-grid power exchange, and thermal devices while minimizing operating cost under variable renewable generation and demand. Although mixed-integer linear programming (MILP) can provide optimal schedules, repeated online optimization may impose a considerable computational burden in real-time applications. This paper proposes a fine-tuned large language model (LLM) framework as a surrogate for MILP-based NZEB scheduling, with the aim of providing computationally efficient decision support and a flexible architecture for future smart-building energy management. The MILP model is first used to generate optimal set-points for DG dispatch, ESS charging/discharging power, grid buy/sell power, and heating/cooling device operation. These optimization-derived input-output pairs are then used to fine-tune the LLM so that it can directly predict near-optimal operational decisions without repeatedly solving the MILP problem. The proposed framework is evaluated against benchmark learning models using the same prediction-error metrics. The results show that the fine-tuned LLM achieves the best overall performance, with a test MAE of 0.0853 and RMSE of 0.286, outperforming both ANN and XGBoost under the same evaluation setting. Compared with ANN, the fine-tuned LLM reduces MAE and RMSE by 88.2% and 33.3%, respectively, while also improving over XGBoost by 79.7% in MAE and 24.7% in RMSE. In addition, the predicted schedules are assessed in terms of operational feasibility and system-level performance. These findings indicate that fine-tuned LLMs can serve as computationally efficient surrogates for near-optimal NZEB control.
S. Mohammadi, A. Hassan, R. Haghighi, V.-H. Bui, and W. Su
Conference paper · 2025 IEEE Energy Conversion Congress and Exposition (ECCE), pp. 1–5, 2025
Abstract
This paper investigates the capability of off-the-shelf large language models (LLMs) to solve the economic dispatch (ED) problem. ED is a hard-constrained optimization problem solved on a day-ahead timescale by grid operators to minimize electricity generation costs while accounting for physical and engineering constraints. Numerous approaches have been proposed, but these typically require either mathematical formulations, face convergence issues, or depend on extensive labeled data and training time. This work implements LLMs enhanced with reasoning capabilities to address the classic lossless ED problem. The proposed approach avoids the need for explicit mathematical formulations, does not suffer from convergence challenges, and requires neither labeled data nor extensive training. A few-shot learning technique is utilized in two different prompting contexts. The IEEE 118-bus system with 19 generation units serves as the evaluation benchmark. Results demonstrate that various prompting strategies enable LLMs to effectively solve the ED problem, offering a convenient and efficient alternative. Consequently, this approach presents a promising future solution for ED tasks, particularly when foundational power system models are available.