IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v12y2024i17p2758-d1472358.html
   My bibliography  Save this article

Leveraging Large Language Models and BERT for Log Parsing and Anomaly Detection

Author

Listed:
  • Yihan Zhou

    (School of Computer Science and Engineering, Central South University, Changsha 410083, China)

  • Yan Chen

    (Logistics Department, Central South University, Changsha 410083, China)

  • Xuanming Rao

    (School of Computer Science and Engineering, Central South University, Changsha 410083, China)

  • Yukang Zhou

    (Department of Electrical and Information Engineering, Hong Kong Polytechnic University, Hong Kong, China)

  • Yuxin Li

    (School of Computer Science and Engineering, Nanyang Technological University, Singapore 639798, Singapore)

  • Chao Hu

    (School of Electronic Information, Central South University, Changsha 410083, China)

Abstract

Computer systems and applications generate large amounts of logs to measure and record information, which is vital to protect the systems from malicious attacks and useful for repairing faults, especially with the rapid development of distributed computing. Among various logs, the anomaly log is beneficial for operations and maintenance (O&M) personnel to locate faults and improve efficiency. In this paper, we utilize a large language model, ChatGPT, for the log parser task. We choose the BERT model, a self-supervised framework for log anomaly detection. BERT, an embedded transformer encoder, with a self-attention mechanism can better handle context-dependent tasks such as anomaly log detection. Meanwhile, it is based on the masked language model task and next sentence prediction task in the pretraining period to capture the normal log sequence pattern. The experimental results on two log datasets show that the BERT model combined with an LLM performed better than other classical models such as Deelog and Loganomaly.

Suggested Citation

  • Yihan Zhou & Yan Chen & Xuanming Rao & Yukang Zhou & Yuxin Li & Chao Hu, 2024. "Leveraging Large Language Models and BERT for Log Parsing and Anomaly Detection," Mathematics, MDPI, vol. 12(17), pages 1-20, September.
  • Handle: RePEc:gam:jmathe:v:12:y:2024:i:17:p:2758-:d:1472358
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/12/17/2758/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/12/17/2758/
    Download Restriction: no
    ---><---

    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:gam:jmathe:v:12:y:2024:i:17:p:2758-:d:1472358. 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.

    We have no bibliographic references for this item. You can help adding them by using 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: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    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.