Automated Root Causing of Cloud Incidents using In-Context Learning with GPT-4

Xuchao Zhang, Supriyo Ghosh, Chetan Bansal, Rujia Wang, Minghua Ma, Yu Kang, Saravan Rajmohan

TL;DR

Researchers at Microsoft have developed a way to automate Root Cause Analysis (RCA) for cloud incidents using GPT-4 and In-Context Learning (ICL). By retrieving similar historical incidents and presenting them as examples in a prompt, their approach outperforms traditional fine-tuned models by nearly 25% and improves correctness by 43.5% according to human experts—all without the massive computational cost of retraining the model.

What Problem Does This Paper Address?

When a major cloud service goes down, "on-call" engineers must perform Root Cause Analysis (RCA) to identify what went wrong and how to fix it. In modern, hyper-scale cloud environments, this is a "needle in a haystack" problem involving massive logs and complex dependencies.

While Large Language Models (LLMs) are great at processing text, applying them to RCA faces three major hurdles:

  1. The Fine-Tuning Tax: Fine-tuning massive models like GPT-4 is prohibitively expensive and requires specialized GPU clusters.
  2. Data Staleness: Cloud systems change daily. A model fine-tuned on last month's data won't know about yesterday's new service deployment.
  3. Hallucinations: Fine-tuned models often "remember" past incidents incorrectly, leading to distorted or fabricated root causes.

Methods

The authors propose an ICL-based framework that treats the LLM as a "vanilla" reasoning engine, feeding it the necessary domain knowledge on the fly. The pipeline consists of four main stages:

  1. Data Cleaning & Summarization: Raw incident reports are messy, containing 10,000+ token stack traces and Base64 images. The team uses GPT-3.5-turbo to condense these into 5–6 sentence summaries that capture the "core" symptoms and features.
  2. Retrieval Indexing: They use a Sentence Transformer model to convert these summaries into mathematical vectors. These are stored in a FAISS (Facebook AI Similarity Search) database.
  3. In-Context Retrieval: When a new incident occurs, the system searches the database for the $k$ most semantically similar historical incidents.
  4. Prompt Engineering: The final prompt sent to GPT-4 includes a task description, the retrieved historical examples (acting as "demonstrations"), and the details of the current incident.

This approach allows the model to "learn" the specific patterns of the cloud environment from the examples provided in the prompt, rather than relying on internal weights from a training phase.

Datasets

The study utilized a massive, real-world dataset from CompanyX (Microsoft):

  • Total Incidents: 101,308 production incidents spanning January 2021 to September 2022.
  • Scope: Over 1,000 different cloud services.
  • Split: 98,308 incidents for the retrieval corpus, 2,000 for validation, and 1,000 for final testing.
  • Comparison Models: The authors compared their GPT-4 ICL approach against fine-tuned versions of GPT-3, CodeGen, OPT, and Bloom.

Key Insights and Ideas

  • Summarization is a Force Multiplier: By using a smaller model (GPT-3.5) to summarize historical incidents first, the authors could fit significantly more "examples" into GPT-4's context window, providing a richer knowledge base for the model to draw from.
  • ICL Beats Fine-Tuning: Surprisingly, a "frozen" GPT-4 provided with 20 relevant examples outperformed a GPT-3 model specifically fine-tuned on 20,000 incidents. This suggests that for rapidly changing domains like AIOps, "retrieval" is more valuable than "memorization."
  • Relevance > Quantity: The researchers found that performance peaks at around 20 examples. Adding more examples beyond that—especially if they are less relevant—actually introduces noise and can degrade the model's reasoning.
  • The "Aha" Moment on RAG: The paper demonstrates that providing full incident examples (Title + Summary + Root Cause) works significantly better than traditional Retrieval-Augmented Generation (RAG) that just provides "chunks" of text. The structure of the example helps the model understand the relationship between symptoms and causes.

Key Results

  • Quantitative: The GPT-4 ICL approach outperformed the fine-tuned GPT-3 baseline by an average of 24.8% across lexical and semantic metrics (like ROUGE-L and BERTScore).
  • Zero-Shot vs. ICL: Moving from zero-shot (no examples) to 20-shot learning improved GPT-4's performance by 49.7%.
  • Human Evaluation: In a blind study with actual incident owners, the ICL approach achieved a 43.5% improvement in correctness and an 8.7% improvement in readability over the fine-tuned model.

Limitations and Future Work

  • The "Black Swan" Problem: The system relies on historical similarity. If a completely novel bug occurs that has never been seen before, the retriever will provide irrelevant examples, potentially leading the model astray.
  • Temporal Blindness: The current system doesn't account for the age of an incident. It might retrieve a "root cause" that was true two years ago but is no longer valid due to architectural changes.
  • Future Directions: The authors suggest integrating "online" diagnostic tools (like live log queries) directly into the LLM's reasoning loop to allow for real-time causal reasoning rather than just historical matching.

Summary updated

Abstract

Root Cause Analysis (RCA) plays a pivotal role in the incident diagnosis process for cloud services, requiring on-call engineers to identify the primary issues and implement corrective actions to prevent future recurrences. Improving the incident RCA process is vital for minimizing service downtime, customer impact and manual toil. Recent advances in artificial intelligence have introduced state-of-the-art Large Language Models (LLMs) like GPT-4, which have proven effective in tackling various AIOps problems, ranging from code authoring to incident management. Nonetheless, the GPT-4 model’s immense size presents challenges when trying to fine-tune it on user data because of the significant GPU resource demand and the necessity for continuous model fine-tuning with the emergence of new data. To address the high cost of fine-tuning LLM, we propose an in-context learning approach for automated root causing, which eliminates the need for fine-tuning. We conduct extensive study over 100,000 production incidents from Microsoft, comparing several large language models using multiple metrics. The results reveal that our in-context learning approach outperforms the previous fine-tuned large language models such as GPT-3 by an average of 24.8% across all metrics, with an impressive 49.7% improvement over the zero-shot model. Moreover, human evaluation involving actual incident owners demonstrates its superiority over the fine-tuned model, achieving a 43.5% improvement in correctness and an 8.7% enhancement in readability. The impressive results demonstrate the viability of utilizing a vanilla GPT model for the RCA task, thereby avoiding the high computational and maintenance costs associated with a fine-tuned model.
BibTeX
@inproceedings{zhang2024automated,
  author = {Xuchao Zhang and Supriyo Ghosh and Chetan Bansal and Rujia Wang and Minghua Ma and Yu Kang and Saravan Rajmohan},
  title = {{Automated Root Causing of Cloud Incidents using In-Context Learning with GPT-4}},
  booktitle = {SIGSOFT FSE Companion},
  year = {2024},
  doi = {10.1145/3663529.3663846},
}

Loading related content...

Figure