Automatic Root Cause Analysis via Large Language Models for Cloud Incidents

Yinfang Chen, Huaibing Xie, Minghua Ma, Yu Kang, Xin Gao, Liu Shi, Yunjie Cao, Xuedong Gao, Hao Fan, Ming Wen, Jun Zeng, Supriyo Ghosh, Xuchao Zhang, Chaoyun Zhang, Qingwei Lin, Saravan Rajmohan, Dongmei Zhang, Tianyin Xu

TL;DR

RCACopilot is an automated, end-to-end system that leverages Large Language Models (LLMs) to revolutionize Root Cause Analysis (RCA) for cloud incidents. By combining human-engineered diagnostic workflows with LLM-powered summarization and few-shot reasoning, it accurately predicts root cause categories and provides explanatory narratives. Evaluated on a year's worth of real-world Microsoft incident data, RCACopilot achieves an impressive Micro-F1 score of 0.766 while dramatically reducing manual debugging overhead.

What Problem Does This Paper Address?

When large-scale cloud services experience disruptions, on-call engineers (OCEs) must rapidly perform Root Cause Analysis (RCA) to mitigate the issue. Traditional approaches rely on static Troubleshooting Guides (TSGs) or manual inspection of fragmented data sources like logs, metrics, and traces.

This manual process suffers from the "information spectrum" dilemma: engineers are either starved of critical runtime data or completely overwhelmed by a sea of noisy, voluminous logs. Furthermore, static TSGs quickly become outdated as cloud architectures evolve, and they struggle to handle entirely new, unseen incident types. While recent attempts have tried to use LLMs by fine-tuning them on incident titles and summaries, these models often miss critical runtime signals and are prone to hallucinations over time.

Methods

RCACopilot splits the RCA process into two main stages: Diagnostic Information Collection and Root Cause Prediction.

Figure 4. RCACopilot architecture.
  1. Diagnostic Information Collection: Instead of dumping raw data into an LLM, RCACopilot uses human-defined, reusable "incident handlers." Triggered by specific alert types, these handlers execute precise actions (like scope switching or targeted database queries) to systematically gather multi-source diagnostic data. This ensures the system captures relevant signals without causing information overload.
  2. Root Cause Prediction:
  3. LLM Summarization: The raw, voluminous diagnostic data is first compressed by an LLM into a concise, informative summary (120–140 words).
  4. Temporal-Aware Nearest Neighbor Search: The system embeds the incident text using a locally trained FastText model. It then searches a historical database for similar incidents using a novel similarity formula that weights both semantic relevance and temporal distance (recency).
  5. Few-Shot Chain-of-Thought (CoT) Prompting: The current incident summary and the top $K$ historical examples are fed into GPT-4. The model is explicitly prompted to reason through the clues, select the most likely root cause category, and generate a natural language explanation.

Datasets

The system was evaluated using a real-world, one-year dataset from Microsoft's Transport service—a massive global email infrastructure handling roughly 150 billion messages daily.

  • Size: 653 complex, production-grade incidents.
  • Split: 75% training (historical database) and 25% testing.
  • Ground Truth: Manually labeled with root cause categories by seasoned on-call engineers.

Key Insights and Ideas

  • Multi-Source Synergy is Essential: Relying on a single data source (like a monitor alert) often masks the true problem. For instance, a connection failure alert might actually be caused by a downstream UDP port exhaustion issue, which can only be uncovered by combining connection logs with socket metrics.
  • Incidents Recur in Bursts: The authors discovered that 93.8% of recurring incidents reappear within a brief span of 20 days. This "aha moment" inspired their custom similarity formula, which prioritizes recent historical incidents over older ones when providing context to the LLM.
  • Handling the "Unseen": Roughly 25% of cloud incidents stem from entirely new root cause categories. Instead of forcing these into pre-existing buckets, RCACopilot's open-ended LLM architecture allows it to propose entirely new category keywords (e.g., identifying an "I/O Bottleneck" before humans formally categorize it as "DiskFull") backed by logical explanations.

Key Results

RCACopilot significantly outperforms traditional machine learning baselines and standard LLM approaches:

  • Accuracy: Utilizing GPT-4, RCACopilot achieved a Micro-F1 score of 0.766 and a Macro-F1 score of 0.533. For comparison, traditional models like XGBoost (0.022 Micro-F1) and FastText (0.076 Micro-F1) failed due to the highly imbalanced, long-tail distribution of incident categories. Fine-tuning a GPT-3.5 model only yielded a Micro-F1 of 0.103.
  • Efficiency: The prediction stage is highly efficient, requiring an average inference time of just 4.205 seconds.
  • Real-World Impact: The automated diagnostic collection component of RCACopilot has been actively deployed across 30 teams at Microsoft for over four years, drastically reducing the time engineers spend triaging incidents and performing postmortems.

Limitations and Future Work

  • Upstream Dependencies: RCACopilot's workflow activation is entirely dependent on system monitors. If a monitor fails to trigger an alert, or if an engineer has not yet defined a handler for a specific alert type, the system cannot automate data collection.
  • LLM Siloing: The predictive component was exclusively evaluated using OpenAI's GPT-3.5 and GPT-4 models. The authors note that performance may vary with other open-source or proprietary LLMs, which remains an area for future exploration.
  • Generalizability: While highly successful within Microsoft's email infrastructure, the prediction module still needs to be evaluated across a broader variety of distinct cloud services to fully prove its generalizability.

Summary updated

BibTeX
@inproceedings{chen2024automatic,
  author = {Yinfang Chen and Huaibing Xie and Minghua Ma and Yu Kang and Xin Gao and Liu Shi and Yunjie Cao and Xuedong Gao and Hao Fan and Ming Wen and Jun Zeng and Supriyo Ghosh and Xuchao Zhang and Chaoyun Zhang and Qingwei Lin and Saravan Rajmohan and Dongmei Zhang and Tianyin Xu},
  title = {{Automatic Root Cause Analysis via Large Language Models for Cloud Incidents}},
  booktitle = {EuroSys},
  year = {2024},
  doi = {10.1145/3627703.3629553},
}
Figure