Skip to article
AHFE AHFE Discoveries AHFE International Open Access Journal
AHFE OPEN ACCESS OPEN ACCESS CONFERENCE PROCEEDINGS PAPER

Prompts of Large Language Model for Commanding Power Grid Operation

1 School of Electric Power Engineering, South China University of Technology, Guangzhou 510641, Guangdong Province, China ↗
2 Department of Electrical Engineering, The Hong Kong Polytechnic University, Hong Kong ↗
Publication year
Digital Object Identifier10.54941/ahfe1004187

Abstract

Large Language Models (LLMs) like ChatGPT can assist people’s general workflows, where the prompt is necessary to inspire the potential of LLMs to solve problems from specified or professional domains like robotics. In the electrical engineering subject or the electric power utility industry, experienced operators and professional experts monitor power grid operation statuses and interact with the grid via human commands on the screen, and components in the grid execute the commands to keep the complex grid safe and economical operation. In this process, human experts edit commands to operate the corresponding software. Human commands are the natural language that the LLM can process. The power grid is composed of generation, transmission, distribution, and other components. Therefore, we redesign the human-computer interaction frame between practitioners and the grid via recurrent prompts to apply the LLM to generate computer programming instructions from the multi-step natural language commands. The programming instruction is executed on system components after being confirmed or revised by human experts, and the quality of generated programs will be gradually improved through human feedback. The idea of this study is originally inspired by studies on controlling individual robotic components by ChatGPT. In the future, we will apply the designed prompt templates to drive the general LLM to generate desired samples which could be used to train an LLM professional in the domain knowledge of electrical engineering to operate multiple types of software for power grid operators.

INTRODUCTION

In the control room of electric power dispatching and control centers, opera- tors are in charge of different tasks to keep the safe and economical operation of the system. Several teams/groups of power grid operators alternate 8-hour or 12-hour shifts to keep the control room staffed around the clock. Accord- ing to a handbook, Running the Electric Power Grid, published by ISO New England in 2016, the control room contains six main operational desks, including the Forecaster, Load Desk, Security Desk, TSO (Tariffs, Sched- ules, and OASIS) Administrator, Generation Desk, Shift Supervisor, Senior System Operator, and spare Station. Specifically, the Forecaster develops the operating plan given demand curves. The Load Desk responds to real-time

© 2023. Published by AHFE Open Access. All rights reserved. 136

Prompts of Large Language Model for Commanding Power Grid Operation 137

conditions and corrects dispatching instructions. The Generation and Secu- rity Desks maintain constant readiness by, on the one hand, communicating with power resources (e.g., coal, oil, nuclear, natural gas, solar, wind, and power transfers with other grids) about their capability to execute and, on the other hand, evaluating the effects of possible losses of hundreds of (or thou- sands of) system components. The TSO Administrator coordinates power transfers with operators in neighboring grid centers to maintain each center on the same page. The Senior System Operator and Shift Supervisor oversee operational activities in the control room to stop abnormal conditions and alert serious issues. Finally, a spare station is staffed in emergencies or utilized to train operators before they are experienced enough to handle real-life sit- uations. At each operational desk, the operator makes the decisions on the power grid operation according to analysis results of running the software for dispatching (Li et al., 2021), forecasting (Dong et al., 2023), and other tasks given the historical records and real-time observations of the power grid states, after coordinating with other desks for accomplishing the oper- ational targets. More detailed investigations for optimal operation (Chen et al., 2021), (Li et al., 2021), (Zhu, 2015) of the power grid (e.g., micro- grid, transmission system, and distribution network) and the multi-energy system (micro-energy grid and integrated energy system), as well as energy forecasting of electric power load demand (including electric vehicle charg- ing load) (Dong et al., 2022), (Zhu et al., 2022), the number of vehicle cars, including electric vehicles (Dong et al., 2020), renewable power generation, such as photovoltaic and wind, have made related software tend to be mature in open-source and commercial fields. One of the key future trends is how to select, combine and implement mature functional software properly to accomplish the power grid operating target.

In Natural Language Processing, a large language model (LLM) is defined as a sophisticated computational system designed to generate human-like text based on input prompts1. The LLM is typically developed based on deep learning techniques, specifically leveraging architectures such as recurrent neural networks (RNNs) and transformers. OpenAI’s GPT-3 has recently attracted the attention of the globe and all walks of life and has become a prime example of an LLM. LLMs are trained on massive amounts of text or language data from diverse sources, e.g., books, articles, websites, and many other textual resources. The training process involves exposing the LLM to vast quantities of text-related data, allowing it to learn adaptive patterns, abstract relationships, and semantic representations of language (Zhao, 2023). The underlying architecture of the LMM enables it to under- stand and generate coherent and contextually relevant responses that are also known as human-like text and can span multiple paragraphs or even much longer compositions to given prompts. Due to its size and complex- ity derived from the learned patterns and associations within the training data, the LLM possesses an expansive knowledge base, opening access to an

1Output from ChatGPT. Open AI. Prompt: “Give me the academic definition of the large language model.” 11 July 2023.

extraordinarily wide range from factual information to linguistic structures to semantic relationships (Liu et al., 2021).

Lately, LLMs, especially recent advances of GPT-3 and GPT-4 (OpenAI, 2022), have inspired valuable tools for numerous applications, including nat- ural language understanding, text generation, translation, summarization, and even assisting with creative writing tasks in some general fields. In other words, the trained LLMs are generally suitable for general tasks and can thus be fine-tuned for specific tasks in some professional domains, such as robotics (Wake, 2023). For instance, the LLMs could be applied to convert natu- ral language commands of humans into executable computer programming instructions with natural language explanations through a readable JSON format while representing changeable operating environments in a formal- ized style and updating them as one of the next inputs together with the next command to take advantage of the memory of the latest manipulations. Before fine-tuning the general LLM into the professional LLM, prompts are designed to obtain the samples from the general LLM, and some capabil- ities of a general LLM can be stimulated to make it serve as the required character through the input prompts. As the development of the LLM is still in its early rising period, there is no established system or methodol- ogy yet. The prompts should be easy-to-customize for the LLM and meet common requirements in the practical application of the professional area (Wake, 2023), for instance, (1) easy integration with existing systems, soft- ware, or tools, (2) applicability to varying environments, (3) the ability to provide long-step commands while minimizing the impact of the LLM’s token limit.

Just like robotics, generating programs for executing commands of operat- ing the multiple components for transmission, distribution, and generation of electricity is a new promising goal considering the power grid is constructed and interconnected with individual components. Meanwhile, the algorithms or methods for forecasting, dispatching, and controlling the power grid are maturing. With the help of the LLM, more attention can be paid to combin- ing or implementing these functional methods appropriately. However, the works that design prompt templates for harnessing the language and interac- tion capabilities of the LLM as a professional interface with a small number of samples to tune up the LLM for arranging mature components or software in specific fields are few, and there is no practical application in electrical engineering (See Figure 1).

To fill the gap, we design the prompt templates that enable the LLM to transform natural language commands into computer programming instruc- tions, assisting the system operator or practitioner in summarizing power grid states and executing the operational commands recurrently through the functional software tedious to input instructions after being confirmed or corrected by human experts. Hence, operators may focus more on the system operation situations and further improve operational services and strategies. In electrical engineering, this work is the first one explor- ing the prompt templates for the LLM, based on the study of prompts in robotics. More investigations are imperative to leverage the power of the LLM.

Prompts of Large Language Model for Commanding Power Grid Operation 139

Figure 1: Prompt templates for large language model to generate a sequence of computer programming instructions from multi-step natural language commands coordinating various components of generation, transmission, etc., and power trans- fer with neighboring grids as a power grid assistant operator in diverse operational environments. (Adapted from the ISO New England, running the electric power grid, 2016).
Original PDF Figure 1:

PROMPT TEMPLATES FOR LARGE LANGUAGE MODEL In this section, we mainly design six main prompts for driving the LLM to generate executable computer programming instructions given natural lan- guage commands of human experts by modifying the prompts designed for controlling robots (Wake, 2023), including (1) the clarification of the role of the LLM as an assistant operator, (2) the definition of system operational commands, (3) the representation of power grid operational environments, (4) the explanation of the output format of the LLM, (5) three examples of the input and output of the LLM, and (6) specified input from the system operator.

At a specific operational workflow, the operator inputs the six prompts above as a template group, together with a natural language command; the LLM outputs the computer programming instructions, containing the evaluation of power grid states or statuses before and after the exact part cor- responding to the input command, and the power grid states can be recorded as the environmental information and utilized as one of the next inputs recur- rently; the feedbacks from human experts during the workflow are also allowed to fine-tune the LLM and improve the performance after the first workflow according to the real-time utilization experience (See Figure 2).

Figure 2: The whole process of the conversation between the LLM and the system operator.
Original PDF Figure 2:

The Role of Large Language Model as an Assistant System Operator The first prompt provides the context for this specific task of generat- ing executable computer programming instructions from natural language commands and clarifies the role that the LLM should play as an assistant operator. In addition, an additional sentence is also input at the end of the prompt to start working until the six prompts are input to the LLM (See Figure 3).

Prompts of Large Language Model for Commanding Power Grid Operation 141

Figure 3: Prompt 1 for explaining the role of the LLM.
Original PDF Figure 3:

Definition of Power Grid Operational Commands The second prompt defines and explains the set of power grid operational computer programming instructions in the manner of callable functions or packaged modules, including consistent processes of evaluating power grid states, understanding tasks, getting related materials, specifying the required input and output result, specifying the core method with the specified input, operating related software of the specified method, gen- erating energy prediction results if the software is about the forecasting task, communicating with power resources for the ability to perform the scheduling results if the software is of the dispatching task, specifying the confirmed schedules, computing system states after executing confirmed schedules, and communicating with system operators to ensure the sys- tem states before and after the command. It should be noted that the processes or steps mentioned above are general procedures of the oper- ator’s regular workflows, and each of them involves varying content of forecasting, dispatching, and other operational tasks introduced in the Intro- duction. Similarly, an extra sentence is supplemented at the end to instruct the LLM to wait for the next prompt until all the prompts are input (See Figure 4).

Representation of Power Grid Operational Environments The third prompt defines the method for representing the related information of the power grid operational environments. The environment is divided into components of the power grid, such as fossil (coal, oil, and nuclear) genera- tors, natural gas units, power transfer lines, solar, e.g., photovoltaic, power generation panels, wind power generation turbines, active power demand loads, and reactive power compensators/ loads, and system statuses of the power grid, including reactive power distributions, active power distribu- tions, and voltage distributions. It shall be noted that we adopt the word status to represent the power grid states instead of “state” to represent the values of the power grid states to avoid possible misunderstandings or over- laps of component states and system status states. Besides, every component involves two major halves, i.e., the historical half of the “here-and-now” and known information, such as wind_ power_readings, and the result half of the “wait-and-see”and output /generated target, e.g., wind_power_forecasts. Then, every output of the result half can be obtained by inputting the histor- ical half to the selected software through the actions defined in the “STATE

Figure 4: Prompt 2 for explaining the power grid operational functions.
Original PDF Figure 4:

LIST,” such as by (<something>). An extra sentence is also added at the end to instruct the LLM to wait for the next prompt until all the prompts are input (See Figure 5).

Figure 5: Prompt 3 for the representation of the power grid operational desks.
Original PDF Figure 5:

Prompts of Large Language Model for Commanding Power Grid Operation 143

The Format of the Output From the Large Language Model A Python dictionary, which can be saved as a JSON file to integrate other programs or processes, is explained as the output format of the LLM within the fourth prompt. The dictionary involves six crucial aspects: task cohe- sion, power grid states before, power grid states after, command summary, and abnormal situation report. Besides, the task cohesion mainly contains the instruction sequence, the system status name, and step commands (See Figure 6). A natural language command input to the LLM will then be divided into multi-step commands to build the dictionary with detailed descriptions through the LLM. An extra sentence is added at the end to instruct the LLM to wait for the next prompt until all the prompts are input.

Figure 6: Prompt 4 for explaining the format of the operational commands generated by the language model.
Original PDF Figure 6:

Examples of the Input and Output of the Language Model Prompt 5 provides three examples of the expected inputs and outputs related to the LLM, and the three commands in green, blue, and red fonts in Figure 1 are included in the three inputs, respectively (See Figure 7). Extensive examples corresponding to the commands exhibited in Figure 1 are welcome, which is hard to obtain. Hence, we only consider three examples to fine-tune the LLM to obtain effective few-shot results in this study (Brown et al., 2020). Similarly, we add an extra sentence at the end of this prompt to instruct the LLM to wait for the final prompt.

Prompts of Large Language Model for Commanding Power Grid Operation 145

Prompts of Large Language Model for Commanding Power Grid Operation 147

Figure 7: Prompt 5 for system operators providing examples of the desired input and output of the language model. A part of the prompt is shown.
Original PDF Figure 7:

Specified Input From the Power Grid Operator The final prompt formats the input specified by the system operator in terms of the environmental information and natural language command. The [ENVIRONMENT] and [COMMAND] can be assigned or replaced with the next input after processing the first command when the [ENVIRONMENT] is blank. Hence, the environmental information at the last time is taken advantage of at the next recurrence (See Figure 8). Furthermore, Prompt 6 defines special rules on the generated Python dictionary for the LLM to follow. Now, the LLM can start generating computer programming instruc- tions after the operator inputs the six essential prompts, including the natural language command, and coordinate the components in the power grid by executing the generated programs after being confirmed or corrected by the experts. It should be noted that the LLM only generates JSON programs that operate existing systems, tools, or software automatically in this study instead of the academic programs that design the algorithms or methods for

dispatching, forecasting, and other tasks with real-time observations or read- ings of power grid states, which is extremely difficult to accomplish in the current stage. In other words, in our opinion, designed prompts will only reliably do as commanded and timely alert abnormal situations following the standard operational workflow while saving time from tedious works gener- ally completed by humans without the creativity of academic or engineering content.

Figure 8: Prompt 6 for system operators inputting template and examples of the actual input. Continuous power grid operations are realized by defining the environment information after the operational output by the LLM as the next input.
Original PDF Figure 8:

IMPLEMENTATION SCHEME AND CASE STUDY To validate the feasibility of the prompt scheme above, we design a case study and implement this scheme, including (1) multi-step manipulations of natu- ral language commands, and (2) correction of the output by feedback from operators. The case study is conducted with one of the most dominant LLMs, i.e., ChatGPT based on GPT-3.5 turbo (OpenAI, 2022), which can be easily accessed by visiting the website or an open-source API on personal computers.

Prompts of Large Language Model for Commanding Power Grid Operation 149

Multi-Step Manipulations of Natural Language Commands Based on the input prompts, ChatGPT outputs JSON files, a part of which has been shown in Figure 9, of a sequence of computer programming instructions from step-by-step natural language commands given the environmental infor- mation of power grid states. The example from Figure 9 involves four commands in Forecaster (See Figure 1, including:

(a) ”Estimate tomorrow’s regional demand.” (b) ”Determine which generating resources will run each hour and how much energy they’ll provide.” (c) ”Select the resources offering to produce electricity at the lowest price in the market.” (d) ”Schedule resources to be in reserve and ready to provide power.”

Figure 9: Multi-step manipulations of a sequence of computer programming instruc- tions for step-by-step natural language commands to a chosen LLM, ChatGPT, given environmental information.
Original PDF Figure 9:

The sequences of functions or modules in JSON programs for human commands are similar because the designed prompts require the selected ChatGPT to generate programs following standard operational workflows of the power grid. Meanwhile, each natural language command input to ChatGPT has been broken down into step-by-step commands by the LLM, illustrating that similar sequences of programming functions or modules involve varying specific contents (tools, software, or systems) for different tasks. Through the LLM, one of the most important jobs for the system operator is to package and improve the modules while confirming or cor- recting the generated instructions and step-by-step commands instead of realizing the required manipulations manually, which may be easy to make mistakes.

Moreover, the GPT-3.5 turbo exhibits the environmental information before and after each manipulation. The latest component states after the last manipulation are adopted to compute the next system statuses in terms of reactive power distribution, active power distribution, and voltage distribution (See Figure 10).

Figure 10: The environmental information output by the chosen LLM called ChatGPT during multi-step manipulations.
Original PDF Figure 10:

Prompts of Large Language Model for Commanding Power Grid Operation 151

Correction of the Output via Feedback from Operators With the real-time conversational design characteristic of ChatGPT, the power grid operator can check and correct the output for each natural language command with domain knowledge in real-life situations. In other words, human interventions such as feedback and preference are allowed to correct the following output, for instance, inserting more or deleting specific functions or modules in the programs. The LLM then outputs the revised program again until the operator confirms to execute it and inputs the next natural language command (See Figure 11). The example shown in Figure 11 involves the specified command “Determine which generating resources will run each hour and how much energy they’ll provide” with human Inter- vention. We believe correcting the output will be the key to improving the performance.

Figure 11: Example of correcting the sequence of instructions for the command “deter- mine which generating resources will run each hour and how much energy they’ll provide” via the LLM, ChatGPT, with human Intervention (feedback or preference).
Original PDF Figure 11:

CONCLUSION

In summary, this work designed the prompt templates to apply the LLM to generate sequences of computer programming instructions from multi- step natural language commands while considering the latest environmental information, e.g., the power grid operational states. The first application of the LLM for commanding the power grid for the system operator would change the human-computer interaction manner between operators and the power grid. The designed prompts could be utilized and tested with different LLMs besides the GPT models in the future. Future work will also realize higher-level logic of the LLM, for instance, generating the program for the conditional command “Set regional demand readings as the estimated value if the out-of-date day is expired. Otherwise, estimate tomorrow’s regional demand.”

ACKNOWLEDGMENT

The authors would like to acknowledge Prof. Dong Zhaoyang (School of Electrical and Electronic Engineering, Nanyang Technological University, Singapore) for his constructive advice for developing LLM-based human- computer interactions. This study was in part supported by the High-end Foreign Experts Project (grant number G2022163018L).

REFERENCES

Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, P., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I. & Amodei, D. (2020). Language Mod- els are Few-Shot Learners. arXiv:2005.14165. DOI: https://doi.org/10.48550/ar Xiv.2005.14165 Chen, Z., Zhu, J., Dong, H., Wu, W. & Zhu, H. (2021). Optimal dispatch of

WT/PV/ES combined generation system based on cyber-physical-social integra- tion. IEEE Transactions on Smart Grid, 13(1), 342–354. Dong, H., Zhu, J., Li, S. & Chen, Z. (2020). Model-driven forecasting for the number of private electric vehicles considering social propaganda and subsidy policy. Proceedings of 12 the International Conference on Applied Energy, 10, 1–4. Dong, H., Zhu, J., Li, S., Luo, T., Li, H. & Huang, Y. (2022). Ultra-short-term

load forecasting based on convolutional-LSTM hybrid networks. 2022 IEEE 31st International Symposium on Industrial Electronics, 2022, 142–148. Dong, H., Zhu, J., Li, S., Wu, W., Zhu, H. & Fan, J. (2023). Short-term residential household reactive power forecasting considering active power demand via deep Transformer sequence-to-sequence networks. Applied Energy, 329, 120281. Li, S., Zhu, J. & Dong, H. (2021). A novel energy sharing mechanism for smart

microgrid. IEEE Transactions on Smart Grid, 12(6), 5475–5478. Li, S., Zhu, J., Dong, H., Zhu, H. & Fan, J. (2022). A novel rolling optimization strategy considering grid-connected power fluctuations smoothing for renewable energy microgrids. Applied Energy, 309, 118441.

Prompts of Large Language Model for Commanding Power Grid Operation 153

Liu, P., Yuan, W., Fu, J., Jiang, Z., Hayashi, H. & Neubig G. (2021). Pre-train, prompt, and predict: A systematic survey of prompting methods in natural lan- guage processing. arXiv: 2107.13586. DOI: https://doi.org/10.48550/arXiv.2107. 13586 OpenAI. (2022). ChatGPT Website: https://openai.com/blog/chatgpt Wake, N., Kanehira, A., Sasabuchi, K., Takamatsu, & J., Ikeuchi, K. (2023). Chat-

GPT empowered long-step robot control in various environments: A case appli- cation. arXiv: 2304.03893. DOI: https://doi.org/10.48550/arXiv.2304.03893 Zhao, W. X., Zhou, K., Li, J., Tang, T., Wang, X., Hou, Y., Min, Y., Zhang, B., Zhang, J., Dong, Z., Du, Y., Yang, C., Chen, Y., Chen, Z., Jiang, J., Ren, R., Li, Y., Tang, X., Liu, Z., Liu, P., Nie, J. & Wen, J. (2023). A Survey of Large Language Models. arXiv: 2303.18223. DOI: https://doi.org/10.48550/arXiv.2303.18223 Zhu, J. (2015). Optimization of power system operation. IEEE. Zhu, J., Dong, H., Zheng, W., Li, S., Huang, Y. & Xi, L. (2022). Review and

prospect of data-driven techniques for load forecasting in integrated energy systems. Applied Energy, 321, 119269.

Cover of the proceedings volume Artificial Intelligence, Social Computing and Wearable Technologies

Explore the complete digital volume

Artificial Intelligence, Social Computing and Wearable Technologies

Read this individual research paper free through the original publisher, or explore the full digital proceedings book.

ISBN 978-1-958651-89-6

Explore this ISBN in the AHFE Bookstore Listed in the July 2026 bookstore catalogue; search by ISBN to confirm current availability · Digital book purchase optional

Explore Related Research

Related research 8 matches

More papers from this volume

← Back to Research ExplorerBrowse the full library →