eess.SYAug 22, 2026

LLMs are Few-Shot Decision-Makers: Generalized Context-Aware Microgrid Frequency Control through Prompt Decision Transformer

Authors: Xu Yang, Chenhui Lin, Haotian Liu, Kaihang Deng, Yunhe Li, Wenchuan Wu

Organizations: State Key Laboratory of Power Systems, Department of Electrical Engineering, Tsinghua University, Beijing 100084, China

Abstract

The rapid evolution of energy structures has positioned microgrids as pivotal components of next-generation power systems, offering enhanced resilience and renewable energy integration. However, the inherent low inertia, complex dynamics, and poor model conditions of microgrids necessitate advanced data-driven frequency control strategies. Although reinforcement learning (RL) has demonstrated certain potential and advantages, existing RL methods often struggle with generalization across diverse microgrid configurations and lack adaptability to unseen environments, particularly when explicit system parameters are unavailable. To address these challenges, in this paper, we introduce a novel prompt decision transformer (Prompt-DT) architecture for microgrid frequency control. Unlike traditional approaches that rely on hard-to-obtain environmental characteristic parameters, the proposed method leverages few-shot expert historical trajectories as prompts to guide autonomous perception and adaptive decision-making. In addition, we propose a context-aware training and execution mechanism utilizing self-supervised contrastive learning to enhance environment recognition and prompt utilization efficiency. In addition, a physics-informed prompt design technique that filters prompts based on cumulative reward and frequency volatility is proposed, ensuring high-quality physical guidance during online execution. Finally, to ensure generalization in unseen environments with limited data, we develop a lightweight finetuning approach that achieves performance comparable to full-parameter finetuning with minimal adjustments.

Explore similar work

CardsList
  1. Real-Time Surrogate Modeling for Fast Transient Prediction in Inverter-Based Microgrids Using CNN and LightGBM

    Mar 31, 2026Osasumwen Cedric Ogiesoba-Eguakun, Kaveh Ashenayi, Suman RathPower SystemsNeural Surrogate Modeling

  2. Bridging Natural Language and Microgrid Dynamics: A Context-Aware Simulator and Dataset

    Apr 7, 2026Tinko Sebastian Bartels, Ruixiang Wu, Xinyu Lu +5Power SystemsDigital Twins

  3. Deep Reinforcement Learning for Optimizing Energy Consumption in Smart Grid Systems

    Feb 20, 2026Abeer Alsheikhi, Amirfarhad Farhadi, Azadeh ZamanifarSample-Efficient RLPower Systems