Yuze Zhang, Jian Zhang, Junyuan Wang, Shan Zhang
Fault diagnosis in distributed systems is challenged by complex service dependencies, cascading anomaly propagation, and similar symptom patterns. This paper proposes a knowledge-enhanced iterative reasoning framework that integrates large language models (LLMs) with a numerical domain knowledge graph (KG). The KG encodes fault-symptom relations, anomaly directions, and training-derived mean and standard-deviation intervals. Structured prompting first generates candidate faults; interval verification then rejects numerically inconsistent candidates. For retained candidates, counterfactual reasoning constructs hierarchical causal chains, KG traversal refines missing or inconsistent links, and a deterministic evidence score supports acceptance, exclusion, early stopping, and fallback across at most five iterations. Under the common 68-case evaluation protocol for eight known single-root-cause faults in the controlled Redis-based testbed, the complete framework achieved 100.00% Accuracy, Macro-F1, and Balanced Accuracy with GPT-4o and GPT-5.2, compared with 91.18% accuracy for KG-only reasoning and 85.29-89.71% for Random Forest, XGBoost, and Transformer baselines. GPT-3.5 reached 98.53%, whereas LLaMA-3.1-8B reached 80.88%, showing that the incremental KG-LLM gain is backbone-dependent. Five GPT-4o repetitions and three GPT-5.2 repetitions yielded 100.00% ± 0.00, and all three metrics remained at 100.00% across the evaluated Z-score thresholds, iteration limits, and interval tolerances. The framework therefore provides highly accurate, stable, and traceable diagnoses within the evaluated Redis-based distributed-service protocol, while providing explicit intermediate reasoning and solution retrieval.