IDEAS home Printed from https://ideas.repec.org/a/plo/pone00/0331516.html

Explaining solar forecasts with generative AI: A two-stage framework combining transformers and LLMs

Author

Listed:
  • Ayesha Siddiqa
  • Nadim Rana
  • Wazir Zada Khan
  • Fathe Jeribi
  • Ali Tahir

Abstract

Accurate and interpretable solar power forecasting is critical for effectively integrating Photo-Voltaic (PV) systems into modern energy infrastructure. This paper introduces a novel two-stage hybrid framework that couples deep learning-based time series prediction with generative Large Language Models (LLMs) to enhance forecast accuracy and model interpretability. At its core, the proposed SolarTrans model leverages a lightweight Transformer-based encoder-decoder architecture tailored for short-term DC power prediction using multivariate inverter and weather data, including irradiance, ambient and module temperatures, and temporal features. Experiments conducted on publicly available datasets from two PV plants over 34 days demonstrate strong predictive performance. The SolarTrans model achieves a Mean Absolute Error (MAE) of 0.0782 and 0.1544, Root Mean Squared Error (RMSE) of 0.1760 and 0.4424, and R2 scores of 0.9692 and 0.7956 on Plant 1 and Plant 2, respectively. On the combined dataset, the model yields an MAE of 0.1105, RMSE of 0.3189, and R2 of 0.8967. To address the interpretability challenge, we fine-tuned the Flan-T5 model on structured prompts derived from domain-informed templates and forecast outputs. The resulting explanation module achieves ROUGE-1, ROUGE-2, ROUGE-L, and ROUGE-Lsum scores of 0.7889, 0.7211, 0.7759, and 0.7771, respectively, along with a BLEU score of 0.6558, indicating high-fidelity generation of domain-relevant natural language explanations.

Suggested Citation

  • Ayesha Siddiqa & Nadim Rana & Wazir Zada Khan & Fathe Jeribi & Ali Tahir, 2025. "Explaining solar forecasts with generative AI: A two-stage framework combining transformers and LLMs," PLOS ONE, Public Library of Science, vol. 20(9), pages 1-22, September.
  • Handle: RePEc:plo:pone00:0331516
    DOI: 10.1371/journal.pone.0331516
    as

    Download full text from publisher

    File URL: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0331516
    Download Restriction: no

    File URL: https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0331516&type=printable
    Download Restriction: no

    File URL: https://libkey.io/10.1371/journal.pone.0331516?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Montaser Abdelsattar & Mohamed A. Ismeil & Karim Menoufi & Ahmed AbdelMoety & Ahmed Emad-Eldeen, 2025. "Evaluating Machine Learning and Deep Learning models for predicting Wind Turbine power output from environmental factors," PLOS ONE, Public Library of Science, vol. 20(1), pages 1-31, January.
    2. Tao Hong & Pierre Pinson & Yi Wang & Rafal Weron & Dazhi Yang & Hamidreza Zareipour, 2020. "Energy forecasting: A review and outlook," WORking papers in Management Science (WORMS) WORMS/20/08, Department of Operations Research and Business Intelligence, Wroclaw University of Science and Technology.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Billé, Anna Gloria & Gianfreda, Angelica & Del Grosso, Filippo & Ravazzolo, Francesco, 2023. "Forecasting electricity prices with expert, linear, and nonlinear models," International Journal of Forecasting, Elsevier, vol. 39(2), pages 570-586.
    2. Uniejewski, Bartosz & Weron, Rafał, 2021. "Regularized quantile regression averaging for probabilistic electricity price forecasting," Energy Economics, Elsevier, vol. 95(C).
    3. Mayer, Martin János & Yang, Dazhi, 2023. "Calibration of deterministic NWP forecasts and its impact on verification," International Journal of Forecasting, Elsevier, vol. 39(2), pages 981-991.
    4. Shadi Tehrani & Jesús Juan & Eduardo Caro, 2022. "Electricity Spot Price Modeling and Forecasting in European Markets," Energies, MDPI, vol. 15(16), pages 1-23, August.
    5. Pierre Pinson & Liyang Han & Jalal Kazempour, 2022. "Regression markets and application to energy forecasting," TOP: An Official Journal of the Spanish Society of Statistics and Operations Research, Springer;Sociedad de Estadística e Investigación Operativa, vol. 30(3), pages 533-573, October.
    6. Maciej Kostrzewski & Jadwiga Kostrzewska, 2021. "The Impact of Forecasting Jumps on Forecasting Electricity Prices," Energies, MDPI, vol. 14(2), pages 1-17, January.
    7. Jiaxin Zhang & Siyuan Shang, 2025. "Fast and Interpretable Probabilistic Solar Power Forecasting via a Multi-Observation Non-Homogeneous Hidden Markov Model," Energies, MDPI, vol. 18(10), pages 1-14, May.
    8. Voyant, Cyril & Notton, Gilles & Duchaud, Jean-Laurent & Gutiérrez, Luis Antonio García & Bright, Jamie M. & Yang, Dazhi, 2022. "Benchmarks for solar radiation time series forecasting," Renewable Energy, Elsevier, vol. 191(C), pages 747-762.
    9. Pesantez, Jorge E. & Li, Binbin & Lee, Christopher & Zhao, Zhizhen & Butala, Mark & Stillwell, Ashlynn S., 2023. "A Comparison Study of Predictive Models for Electricity Demand in a Diverse Urban Environment," Energy, Elsevier, vol. 283(C).
    10. Siwei Cheng & Jing Shi & Qi Cheng & Xinmeng Zhou & Shuai Zeng, 2025. "Hybrid Model for Medium-Term Load Forecasting in Urban Power Grids," Energies, MDPI, vol. 18(16), pages 1-24, August.
    11. Wen, Honglin & Pinson, Pierre & Gu, Jie & Jin, Zhijian, 2024. "Wind energy forecasting with missing values within a fully conditional specification framework," International Journal of Forecasting, Elsevier, vol. 40(1), pages 77-95.
    12. Weronika Nitka & Rafał Weron, 2023. "Combining predictive distributions of electricity prices. Does minimizing the CRPS lead to optimal decisions in day-ahead bidding?," Operations Research and Decisions, Wroclaw University of Science and Technology, Faculty of Management, vol. 33(3), pages 105-118.
    13. Qinghe Zhao & Xinyi Liu & Junlong Fang, 2023. "Extreme Gradient Boosting Model for Day-Ahead STLF in National Level Power System: Estonia Case Study," Energies, MDPI, vol. 16(24), pages 1-29, December.
    14. Leonard Burg & Gonca Gürses-Tran & Reinhard Madlener & Antonello Monti, 2021. "Comparative Analysis of Load Forecasting Models for Varying Time Horizons and Load Aggregation Levels," Energies, MDPI, vol. 14(21), pages 1-16, November.
    15. Yang, Dazhi & van der Meer, Dennis, 2021. "Post-processing in solar forecasting: Ten overarching thinking tools," Renewable and Sustainable Energy Reviews, Elsevier, vol. 140(C).
    16. Massidda, Luca & Marrocu, Marino, 2023. "Total and thermal load forecasting in residential communities through probabilistic methods and causal machine learning," Applied Energy, Elsevier, vol. 351(C).
    17. Hugo Radet & Bruno Sareni & Xavier Roboam, 2023. "Synthesis of Solar Production and Energy Demand Profiles Using Markov Chains for Microgrid Design," Energies, MDPI, vol. 16(23), pages 1-12, December.
    18. Dai, Yeming & Yang, Xinyu & Leng, Mingming, 2022. "Forecasting power load: A hybrid forecasting method with intelligent data processing and optimized artificial intelligence," Technological Forecasting and Social Change, Elsevier, vol. 182(C).
    19. Visser, L.R. & AlSkaif, T.A. & Khurram, A. & Kleissl, J. & van Sark, W.G.H.J.M., 2024. "Probabilistic solar power forecasting: An economic and technical evaluation of an optimal market bidding strategy," Applied Energy, Elsevier, vol. 370(C).
    20. Wang, Wenting & Guo, Yufeng & Yang, Dazhi & Zhang, Zili & Kleissl, Jan & van der Meer, Dennis & Yang, Guoming & Hong, Tao & Liu, Bai & Huang, Nantian & Mayer, Martin János, 2024. "Economics of physics-based solar forecasting in power system day-ahead scheduling," Renewable and Sustainable Energy Reviews, Elsevier, vol. 199(C).

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:plo:pone00:0331516. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: plosone (email available below). General contact details of provider: https://journals.plos.org/plosone/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.