IDEAS home Printed from https://ideas.repec.org/a/plo/pone00/0331516.html
   My bibliography  Save this article

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. 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.
    2. 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.
    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. 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.
    3. Maciej Kostrzewski & Jadwiga Kostrzewska, 2021. "The Impact of Forecasting Jumps on Forecasting Electricity Prices," Energies, MDPI, vol. 14(2), pages 1-17, January.
    4. 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).
    5. 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.
    6. 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.
    7. 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.
    8. 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).
    9. Jonathan Roth & Jayashree Chadalawada & Rishee K. Jain & Clayton Miller, 2021. "Uncertainty Matters: Bayesian Probabilistic Forecasting for Residential Smart Meter Prediction, Segmentation, and Behavioral Measurement and Verification," Energies, MDPI, vol. 14(5), pages 1-22, March.
    10. Katarzyna Maciejowska, 2022. "A portfolio management of a small RES utility with a Structural Vector Autoregressive model of German electricity markets," Papers 2205.00975, arXiv.org.
    11. Mayer, Martin János & Yang, Dazhi, 2023. "Pairing ensemble numerical weather prediction with ensemble physical model chain for probabilistic photovoltaic power forecasting," Renewable and Sustainable Energy Reviews, Elsevier, vol. 175(C).
    12. Georgios Papazoglou & Pandelis Biskas, 2022. "Review of Methodologies for the Assessment of Feasible Operating Regions at the TSO–DSO Interface," Energies, MDPI, vol. 15(14), pages 1-24, July.
    13. Dariusz Borkowski & Michał Jaśkiewicz, 2025. "Forecasting Electricity Prices Three Days in Advance: Comparison Between Multilayer Perceptron and Support Vector Machine Networks," Energies, MDPI, vol. 18(17), pages 1-25, September.
    14. Wu, Thomas & Hu, Ruifeng & Zhu, Hongyu & Jiang, Meihui & Lv, Kunye & Dong, Yunxuan & Zhang, Dongdong, 2024. "Combined IXGBoost-KELM short-term photovoltaic power prediction model based on multidimensional similar day clustering and dual decomposition," Energy, Elsevier, vol. 288(C).
    15. Nikolaos Kolokas & Dimosthenis Ioannidis & Dimitrios Tzovaras, 2021. "Multi-Step Energy Demand and Generation Forecasting with Confidence Used for Specification-Free Aggregate Demand Optimization," Energies, MDPI, vol. 14(11), pages 1-36, May.
    16. Dong, Xianzhou & Guo, Weiyong & Zhou, Cheng & Luo, Yongqiang & Tian, Zhiyong & Zhang, Limao & Wu, Xiaoying & Liu, Baobing, 2024. "Hybrid model for robust and accurate forecasting building electricity demand combining physical and data-driven methods," Energy, Elsevier, vol. 311(C).
    17. Marta Poncela-Blanco & Pilar Poncela, 2021. "Improving Wind Power Forecasts: Combination through Multivariate Dimension Reduction Techniques," Energies, MDPI, vol. 14(5), pages 1-16, March.
    18. Yang, Dazhi & Kleissl, Jan, 2023. "Summarizing ensemble NWP forecasts for grid operators: Consistency, elicitability, and economic value," International Journal of Forecasting, Elsevier, vol. 39(4), pages 1640-1654.
    19. Grothe, Oliver & Kächele, Fabian & Krüger, Fabian, 2023. "From point forecasts to multivariate probabilistic forecasts: The Schaake shuffle for day-ahead electricity price forecasting," Energy Economics, Elsevier, vol. 120(C).
    20. Nametala, Ciniro Aparecido Leite & Faria, Wandry Rodrigues & Lage, Guilherme Guimarães & Pereira, Benvindo Rodrigues, 2023. "Analysis of hourly price granularity implementation in the Brazilian deregulated electricity contracting environment," Utilities Policy, Elsevier, vol. 81(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.