This paper proposes a few-shot classification framework based on Large Language Models (LLMs) to predict whether the next day will have spikes in real-time electricity prices. The approach aggregates system state information, including electricity demand, renewable generation, weather forecasts, and recent electricity prices, into a set of statistical features that are formatted as natural-language prompts and fed to an LLM along with general instructions. The model then determines the likelihood that the next day would be a spike day and reports a confidence score. Using historical data from the Texas electricity market, we demonstrate that this few-shot approach achieves performance comparable to supervised machine learning models, such as Support Vector Machines and XGBoost, and outperforms the latter two when limited historical data are available. These findings highlight the potential of LLMs as a data-efficient tool for classifying electricity price spikes in settings with scarce data.
The short-term behavior of electricity prices has become increasingly difficult to predict as modern power systems incorporate higher levels of renewable generation and face greater variability in operating conditions. These have led to more frequent fluctuations in net load and produced highly volatile real-time price patterns [1]. Because operators and market participants rely on accurate next-day forecasts for scheduling, hedging, and risk management, the ability to anticipate price spikes is increasingly important. In practice, many market participants rely on automated bidding and riskmanagement software trained on the majority of normal days. While these systems perform reliably under typical conditions, they often perform poorly during extreme price events, leading to financial losses and inefficient market responses. However, forecasting these events remains challenging due to the combined effects of operational uncertainty, renewable forecast errors, evolving demand profiles, adverse weather conditions, and persistent transmission congestion.
A wide range of statistical and machine-learning models has been applied to electricity price forecasting, with most focusing on regression-based prediction. Traditional time-series methods and modern deep-learning architectures, including Multi-Layer Perceptron (MLP) [2], hybrid neural networks [3], and transformer-based models [4], aim to directly estimate future prices. Conformal prediction has also been explored to quantify predictive uncertainty [5]. While these methods capture general price dynamics, they struggle with rare and highly nonlinear spike events, which are overshadowed by the predominance of non-spike prices in training.
In practical operations, market participants frequently need to know whether the next day is likely to experience abnormally high prices, the ability to flag such days in advance would warrant hedging or operational adjustments. This motivates electricity spike classification, in which the goal is to determine whether prices will exceed a critical threshold. Prior studies have investigated such approaches using support vector machines (SVMs) [6] and weighted K-nearest neighbor (WKNN) models [7], with additional methods surveyed in [8]. Although these approaches improve sensitivity to extreme events, they typically require large labeled datasets and may degrade when spikes are infrequent or when system conditions shift over time. Such spike days also affect residential consumers, who are generally risk-averse. With the increasing adoption of virtual power plants that aggregate residential batteries for market participation [9], poor anticipation of these days can lead to inefficient bidding and financial losses.
Large language models (LLMs) can interpret structured numerical data expressed in natural language and link system signals, including demand variability, renewable output, and price trends, to price outcomes. They also perform well with limited labeled data, addressing the rarity of spike events and changing power conditions. Recently, LLMs has been used in some power system applications [10]- [13]. Motivated by this, we propose a few-shot LLM-based classifier that estimates the likelihood of next-day real-time price spikes from textual system descriptions. Our main contributions are:
• We develop a few-shot classification framework that leverages LLMs to flag whether the next day will be an electricity price spike day in the real-time market, based on statistical summaries of system conditions. • We introduce a simple but effective procedure that converts market and system variables, including forecasts and recent price dynamics, into textual features suitable for LLM-based inference.
). A confidence level as a decimal between 0.00 and 1.00. Do not include any additional explanation. Be careful for the spike prediction when DAP has no spike, historically it only occurs 10% times.
Requested Date
Prompt Construction Inference Response Parsing
Output: “0 or 1, probability_of_yes” Fig. 1. The pipeline for the proposed approach.
Texas market data and benchmark its performance against SVM and XGBoost, despite the latter two being trained on a much larger dataset. • We demonstrate that LLM-based predictors are effective in limited-data settings, highlighting their value as a dataefficient approach to electricity price classification.
The remainder of the paper is organized as follows: Section II introduces the framework. Section III presents the case study, and Section IV concludes the paper.
We present an LLM-based framework to predict whether the next day will feature real-time electricity price spikes. The framework consists of three sequential components: a data preprocessor, which integrates and transforms electricity system wide datasets into structured learning features; a prompt generator, which converts daily feature vectors into textual representations and retrieves relevant few-shot examples using embed
This content is AI-processed based on open access ArXiv data.