arXiv:2509.20798cs.AIcs.SE2025-09

让大模型像专家一样分步推理日志,提升故障诊断准确率

LogReasoner: Empowering LLMs with Expert-like Coarse-to-Fine Reasoning for Automated Log Analysis

  • 分两阶段增强:先构建专家级思维框架,再细化具体分析步骤
  • 在4个日志任务上超越现有大模型,实现顶尖性能
  • 适合系统监控、自动化运维人员快速定位复杂故障

日志分析对监控复杂系统健康状态和诊断故障至关重要。近年来,大语言模型(LLMs)凭借其推理能力为自动化日志分析带来新机遇,可完成异常检测与故障预测等任务。然而,通用大模型难以形成符合专家认知的结构化推理流程,且推理细节不够精确。为此,我们提出LogReasoner,一种面向日志分析的粗粒度到细粒度推理增强框架,使大模型能如专家般思考。该框架包含两个阶段:(1) 粗粒度增强,基于收集的排错流程图与已有任务构建高层专家思维,引导大模型形成结构化推理路径;(2) 细粒度增强,先用任务特定的逐步解决方案微调大模型以强化实例化推理能力,再通过偏好学习纠正错误,进一步提升分析的精细度与准确性。我们在Qwen-2.5和Llama-3等开源大模型上,针对四个不同的日志分析任务进行了评估。实验结果表明,LogReasoner显著优于现有大模型,达到当前最优表现,验证了其在提升大模型日志分析推理能力方面的有效性。

原文摘要 · Abstract (English)

Log analysis is crucial for monitoring system health and diagnosing failures in complex systems. Recent advances in large language models (LLMs) offer new opportunities for automated log analysis, leveraging their reasoning capabilities to perform tasks such as anomaly detection and failure prediction. However, general-purpose LLMs struggle to formulate structured reasoning workflows that align with expert cognition and deliver precise details of reasoning steps. To address these challenges, we propose LogReasoner, a coarse-to-fine reasoning enhancement framework designed to enable LLMs to reason log analysis tasks like experts. LogReasoner consists of two stages: (1) coarse-grained enhancement of expert thinking, where high-level expert thoughts are constructed from collected troubleshooting flowcharts and existing tasks to enable LLMs to formulate structured reasoning workflows and (2) fine-grained enhancement of specific steps, where we first fine-tune the LLM with task-specific stepwise solutions to enhance the LLM for instantiated reasoning, then employ the preference learning to calibrate the LLM's reasoning details from its mistakes, further strengthen the LLM's analytical granularity and correctness. We evaluate LogReasoner on four distinct log analysis tasks using open-source LLMs such as Qwen-2.5 and Llama-3. Experimental results show that LogReasoner significantly outperforms existing LLMs, achieving state-of-the-art performance and demonstrating its effectiveness in enhancing the reasoning capabilities of LLMs for log analysis.

日志分析大模型推理自动化运维

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。