Explaining Tree Model Decisions in Natural Language for Network Intrusion Detection

Noah Ziems, Gang Liu, John Flanagan, Meng Jiang

TL;DR

This paper introduces LLM-DTE, a framework that uses Large Language Models (LLMs) to translate complex decision tree paths into intuitive, natural language explanations for network security. To prove these explanations actually work, the authors also developed a novel evaluation method using automatically generated "counterfactual quizzes" to measure how well humans truly understand the model's decision boundaries.

What Problem Does This Paper Address?

Network Intrusion Detection (NID) systems are the first line of defense against cyberattacks, but they face a significant usability gap. While machine learning models like decision trees are technically "interpretable," their raw output—a series of feature thresholds and boolean logic—is often gibberish to a security analyst who isn't also a data scientist.

Furthermore, standard Explainable AI (XAI) tools might tell you which features were important, but they can't explain why those features matter in the real world. For example, a model might flag a specific "source port" as suspicious, but a human needs to know the security context of that port to make an informed decision. The authors aim to bridge this gap by providing explanations that require zero machine learning background and include relevant domain knowledge.

Methods

The researchers proposed a two-part system called LLM-DTE (Large Language Model Decision Tree Explanations):

  1. Explanation Generation: When a decision tree classifies network traffic (e.g., as "Benign" or a "Threat"), the system extracts the specific path taken through the tree. This path, along with metadata about the features, is fed into an LLM (specifically GPT-4). The LLM is prompted to synthesize this into a natural language narrative that abstracts away the underlying math and adds helpful background context about network protocols and attack types.
  2. Counterfactual Quiz Evaluation: To move beyond subjective "do you like this text?" ratings, the authors introduced a rigorous human evaluation framework. A Counterfactual Quiz Generator uses rule-based templates to create "what-if" questions based on the decision tree's logic (e.g., "If the number of bytes had been 10 instead of 5, would the outcome change?"). By seeing if humans can correctly predict the model's behavior after reading an explanation, the researchers can objectively measure true understanding.
Figure 1: The overall framework for our proposed approach (LLM-DTE). Given network traffic data, a decision tree evaluates the data and classifies it as either Benign or Threat. Path and structure data from the decision tree are then provided to a large language model to generate an explanation. At the same time, quiz questions are generated using rule-based templates (not LLMs). Finally, a human evaluator is provided with the generated explanation and tasked with answering quiz questions to test their understanding.

Datasets

  • NF-BoT: An industry-standard network intrusion dataset containing 600,000 samples. It includes metadata like packet counts, TCP flags, flow duration, and IP addresses.
  • Iris Dataset: Used as a preliminary case study to demonstrate the counterfactual quiz logic in a simpler, well-known classification environment.

Key Insights and Ideas

  • Contextual Intelligence: Unlike rule-based templates (e.g., "Feature X > 0.5"), LLMs can explain why a feature is relevant. If a model flags a high number of packets, the LLM can explain that this is a common characteristic of a DDoS attack, providing immediate value to a security operator.
  • Objective XAI Evaluation: The "counterfactual quiz" is a major contribution. It treats explanation quality as a functional metric: if an explanation is good, the reader should be able to accurately simulate the model's logic in their head for new, hypothetical scenarios.
  • User-Centric Design: LLMs allow for "tuning" the explanation. A prompt can be adjusted to generate a high-level summary for a manager or a technical deep-dive for a senior security engineer.

Key Results

The study compared LLM-generated explanations against traditional rule-based templates using 10 human evaluators (half with ML backgrounds, half with security backgrounds):

  • Improved Understanding: Humans scored 39.5% higher on understanding quizzes when using LLM-DTE compared to rule-based explanations (17.3 vs. 12.4 out of 25).
  • Qualitative Preference: LLM-DTE was rated "High" for readability 15% more often and "High" for quality nearly twice as often as the baseline.
  • Background Knowledge: The LLM approach was rated "High" for its use of background knowledge 70% more often than rule-based methods, confirming that the LLM successfully brought in external security context.

Limitations and Future Work

  • Latency and Cost: Using high-end LLMs like GPT-4 is significantly slower and more expensive than simple text templates, which might be a hurdle for real-time NID systems.
  • Tree Complexity: As decision trees grow deeper, the prompts become longer and more complex, which can lead to a degradation in the LLM's explanation quality.
  • Future Directions: The authors suggest exploring Retrieval-Augmented Generation (RAG) to pull in even more specific, up-to-date security documentation to further enrich the explanations.

Summary updated

BibTeX
@misc{ziems2023explaining,
  author = {Noah Ziems and Gang Liu and John Flanagan and Meng Jiang},
  title = {{Explaining Tree Model Decisions in Natural Language for Network Intrusion Detection}},
  year = {2023},
  eprint = {2310.19658},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.19658},
}
Figure