IDEAS home Printed from https://ideas.repec.org/a/eee/energy/v318y2025ics0360544225004669.html
   My bibliography  Save this article

Automated data-driven building energy load prediction method based on generative pre-trained transformers (GPT)

Author

Listed:
  • Zhang, Chaobo
  • Zhang, Jian
  • Zhao, Yang
  • Lu, Jie

Abstract

Generative pre-trained transformers (GPT) have shown remarkable capabilities in automated code generation for data-driven building energy load prediction scenarios, leading to substantial savings in time and costs. However, it is quite difficult for inexperienced users to provide high-quality prompts to GPT for generating satisfactory codes. To address this challenge, a GPT-based automated data-driven building energy load forecasting method is proposed in this study. Prompting functions are designed to automatically generate prompts for model training and deployment. Bayesian optimization is utilized to optimize the prompting functions for improving the prediction accuracy of GPT-generated codes. External knowledge bases are developed to improve the code correctness of GPT by adding additional knowledge to prompts. Furthermore, a self-correction strategy is designed to enable GPT to automatically correct errors in GPT-generated codes. This method is employed to forecast the energy loads of two real buildings for performance evaluation. GPT-3.5 is utilized in the evaluation process. The codes generated by this method exhibit high prediction accuracy, achieving an average R2 of 0.95 for the two buildings. The code correctness of GPT-3.5 is increased by an average of 90.0 % by using the external knowledge bases. Moreover, the self-correction strategy effectively corrects some unpredictable mistakes made by GPT-3.5.

Suggested Citation

  • Zhang, Chaobo & Zhang, Jian & Zhao, Yang & Lu, Jie, 2025. "Automated data-driven building energy load prediction method based on generative pre-trained transformers (GPT)," Energy, Elsevier, vol. 318(C).
  • Handle: RePEc:eee:energy:v:318:y:2025:i:c:s0360544225004669
    DOI: 10.1016/j.energy.2025.134824
    as

    Download full text from publisher

    File URL: http://www.sciencedirect.com/science/article/pii/S0360544225004669
    Download Restriction: Full text for ScienceDirect subscribers only

    File URL: https://libkey.io/10.1016/j.energy.2025.134824?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
    ---><---

    As the access to this document is restricted, you may want to

    for a different version of it.

    References listed on IDEAS

    as
    1. Zhang, Chaobo & Li, Junyang & Zhao, Yang & Li, Tingting & Chen, Qi & Zhang, Xuejun & Qiu, Weikang, 2021. "Problem of data imbalance in building energy load prediction: Concept, influence, and solution," Applied Energy, Elsevier, vol. 297(C).
    2. Zheng, Peijun & Zhou, Heng & Liu, Jiang & Nakanishi, Yosuke, 2023. "Interpretable building energy consumption forecasting using spectral clustering algorithm and temporal fusion transformers architecture," Applied Energy, Elsevier, vol. 349(C).
    3. Lu, Chujie & Li, Sihui & Reddy Penaka, Santhan & Olofsson, Thomas, 2023. "Automated machine learning-based framework of heating and cooling load prediction for quick residential building design," Energy, Elsevier, vol. 274(C).
    4. Zhang, Jian & Zhang, Chaobo & Lu, Jie & Zhao, Yang, 2025. "Domain-specific large language models for fault diagnosis of heating, ventilation, and air conditioning systems by labeled-data-supervised fine-tuning," Applied Energy, Elsevier, vol. 377(PA).
    5. Pan, Yue & Zhang, Limao, 2020. "Data-driven estimation of building energy consumption with multi-source heterogeneous data," Applied Energy, Elsevier, vol. 268(C).
    6. Arjunan, Pandarasamy & Poolla, Kameshwar & Miller, Clayton, 2020. "EnergyStar++: Towards more accurate and explanatory building energy benchmarking," Applied Energy, Elsevier, vol. 276(C).
    7. Li, Guannan & Li, Fan & Ahmad, Tanveer & Liu, Jiangyan & Li, Tao & Fang, Xi & Wu, Yubei, 2022. "Performance evaluation of sequence-to-sequence-Attention model for short-term multi-step ahead building energy predictions," Energy, Elsevier, vol. 259(C).
    8. Elnour, Mariam & Himeur, Yassine & Fadli, Fodil & Mohammedsherif, Hamdi & Meskin, Nader & Ahmad, Ahmad M. & Petri, Ioan & Rezgui, Yacine & Hodorog, Andrei, 2022. "Neural network-based model predictive control system for optimizing building automation and management systems of sports facilities," Applied Energy, Elsevier, vol. 318(C).
    9. Lu, Hongfang & Cheng, Feifei & Ma, Xin & Hu, Gang, 2020. "Short-term prediction of building energy consumption employing an improved extreme gradient boosting model: A case study of an intake tower," Energy, Elsevier, vol. 203(C).
    10. Fan, Cheng & Xiao, Fu & Yan, Chengchu & Liu, Chengliang & Li, Zhengdao & Wang, Jiayuan, 2019. "A novel methodology to explain and evaluate data-driven building energy performance models based on interpretable machine learning," Applied Energy, Elsevier, vol. 235(C), pages 1551-1560.
    11. Zhong, Hai & Wang, Jiajun & Jia, Hongjie & Mu, Yunfei & Lv, Shilei, 2019. "Vector field-based support vector regression for building energy consumption prediction," Applied Energy, Elsevier, vol. 242(C), pages 403-414.
    12. Fan, Cheng & Lei, Yutian & Sun, Yongjun & Piscitelli, Marco Savino & Chiosa, Roberto & Capozzoli, Alfonso, 2022. "Data-centric or algorithm-centric: Exploiting the performance of transfer learning for improving building energy predictions in data-scarce context," Energy, Elsevier, vol. 240(C).
    13. Afzal, Sadegh & Ziapour, Behrooz M. & Shokri, Afshar & Shakibi, Hamid & Sobhani, Behnam, 2023. "Building energy consumption prediction using multilayer perceptron neural network-assisted models; comparison of different optimization algorithms," Energy, Elsevier, vol. 282(C).
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Lin, Xiaojie & Zhang, Ning & Du-Ikonen, Liuliu & Yuan, Xiaolei & Zhong, Wei, 2025. "Investigation of building load prediction models based on integration of mechanism methods and data-driven models," Energy, Elsevier, vol. 324(C).

    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. Guo, Yanhua & Wang, Ningbo & Shao, Shuangquan & Huang, Congqi & Zhang, Zhentao & Li, Xiaoqiong & Wang, Youdong, 2024. "A review on hybrid physics and data-driven modeling methods applied in air source heat pump systems for energy efficiency improvement," Renewable and Sustainable Energy Reviews, Elsevier, vol. 204(C).
    2. Li, Guannan & Wu, Yubei & Yoon, Sungmin & Fang, Xi, 2024. "Comprehensive transferability assessment of short-term cross-building-energy prediction using deep adversarial network transfer learning," Energy, Elsevier, vol. 299(C).
    3. Jeeyoung Lim & Joseph J. Kim & Sunkuk Kim, 2021. "A Holistic Review of Building Energy Efficiency and Reduction Based on Big Data," Sustainability, MDPI, vol. 13(4), pages 1-18, February.
    4. Venkatraj, V. & Dixit, M.K., 2022. "Challenges in implementing data-driven approaches for building life cycle energy assessment: A review," Renewable and Sustainable Energy Reviews, Elsevier, vol. 160(C).
    5. Li, Guannan & Li, Fan & Ahmad, Tanveer & Liu, Jiangyan & Li, Tao & Fang, Xi & Wu, Yubei, 2022. "Performance evaluation of sequence-to-sequence-Attention model for short-term multi-step ahead building energy predictions," Energy, Elsevier, vol. 259(C).
    6. Lin, Xiaojie & Zhang, Ning & Du-Ikonen, Liuliu & Yuan, Xiaolei & Zhong, Wei, 2025. "Investigation of building load prediction models based on integration of mechanism methods and data-driven models," Energy, Elsevier, vol. 324(C).
    7. Mohan, Ritwik & Pachauri, Nikhil, 2025. "An ensemble model for the energy consumption prediction of residential buildings," Energy, Elsevier, vol. 314(C).
    8. Fan, Cheng & Lei, Yutian & Sun, Yongjun & Piscitelli, Marco Savino & Chiosa, Roberto & Capozzoli, Alfonso, 2022. "Data-centric or algorithm-centric: Exploiting the performance of transfer learning for improving building energy predictions in data-scarce context," Energy, Elsevier, vol. 240(C).
    9. Zhang, Chaobo & Li, Junyang & Zhao, Yang & Li, Tingting & Chen, Qi & Zhang, Xuejun & Qiu, Weikang, 2021. "Problem of data imbalance in building energy load prediction: Concept, influence, and solution," Applied Energy, Elsevier, vol. 297(C).
    10. Fan, Cheng & Sun, Yongjun & Xiao, Fu & Ma, Jie & Lee, Dasheng & Wang, Jiayuan & Tseng, Yen Chieh, 2020. "Statistical investigations of transfer learning-based methodology for short-term building energy predictions," Applied Energy, Elsevier, vol. 262(C).
    11. Liang, Xinbin & Liu, Zhuoxuan & Wang, Jie & Jin, Xinqiao & Du, Zhimin, 2023. "Uncertainty quantification-based robust deep learning for building energy systems considering distribution shift problem," Applied Energy, Elsevier, vol. 337(C).
    12. Fan, Cheng & Chen, Ruikun & Mo, Jinhan & Liao, Longhui, 2024. "Personalized federated learning for cross-building energy knowledge sharing: Cost-effective strategies and model architectures," Applied Energy, Elsevier, vol. 362(C).
    13. Yu, Fu Wing & Ho, Wai Tung & Wong, Chak Fung Jeff, 2025. "Integrating time series decomposition and multivariable approaches for enhanced cooling energy management," Energy, Elsevier, vol. 318(C).
    14. Sun, Jian & Liu, Gang & Sun, Boyang & Xiao, Gang, 2021. "Light-stacking strengthened fusion based building energy consumption prediction framework via variable weight feature selection," Applied Energy, Elsevier, vol. 303(C).
    15. Gao, Lei & Liu, Tianyuan & Cao, Tao & Hwang, Yunho & Radermacher, Reinhard, 2021. "Comparing deep learning models for multi energy vectors prediction on multiple types of building," Applied Energy, Elsevier, vol. 301(C).
    16. Xing, Zhuoqun & Pan, Yiqun & Yang, Yiting & Yuan, Xiaolei & Liang, Yumin & Huang, Zhizhong, 2024. "Transfer learning integrating similarity analysis for short-term and long-term building energy consumption prediction," Applied Energy, Elsevier, vol. 365(C).
    17. Yesilyurt, Hasan & Dokuz, Yesim & Dokuz, Ahmet Sakir, 2024. "Data-driven energy consumption prediction of a university office building using machine learning algorithms," Energy, Elsevier, vol. 310(C).
    18. Chou, Jui-Sheng & Truong, Dinh-Nhat & Kuo, Ching-Chiun, 2021. "Imaging time-series with features to enable visual recognition of regional energy consumption by bio-inspired optimization of deep learning," Energy, Elsevier, vol. 224(C).
    19. Shen, Yuxuan & Pan, Yue, 2023. "BIM-supported automatic energy performance analysis for green building design using explainable machine learning and multi-objective optimization," Applied Energy, Elsevier, vol. 333(C).
    20. Chen, Zhelun & O’Neill, Zheng & Wen, Jin & Pradhan, Ojas & Yang, Tao & Lu, Xing & Lin, Guanjing & Miyata, Shohei & Lee, Seungjae & Shen, Chou & Chiosa, Roberto & Piscitelli, Marco Savino & Capozzoli, , 2023. "A review of data-driven fault detection and diagnostics for building HVAC systems," Applied Energy, Elsevier, vol. 339(C).

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;

    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:eee:energy:v:318:y:2025:i:c:s0360544225004669. 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: Catherine Liu (email available below). General contact details of provider: http://www.journals.elsevier.com/energy .

    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.