Explaining Language Model Predictions with High-Impact Concepts

Ruochen Zhao, Tan Wang, Yongjie Wang, Shafiq JotyEACL (Findings) 2024

Abstract

To encourage fairness and transparency, there exists an urgent demand for deriving reliable explanations for large language models (LLMs). One promising solution is concept-based explanations—human-understandable concepts derived from internal representations. However, due to the compositional nature of languages, current methods mostly discover correlational explanations instead of causal features. We propose HI-concept, a novel framework to provide impact-aware explanations that are robust to feature changes and influential to the model’s predictions. Specifically, we extract predictive high-level features from hidden layer activations and optimize for features whose existence causes the output predictions to change substantially. Extensive experiments demonstrate that our method achieves superior results on predictive impact, explainability, and faithfulness compared to baselines, especially for LLMs.

Introduction: The Black Box Challenge

As Large Language Models (LLMs) are increasingly deployed in high-stakes fields like recruitment and personalized medicine, their "black box" nature becomes a significant liability. Understanding why a model made a specific prediction is no longer just a research interest; it is a requirement for safety and accountability.

Current "concept-based" explanations attempt to map a model's internal mathematical representations to human ideas, such as "acting" or "directing" in a movie review. However, these methods often fall into the trap of confusing correlation with causation. For instance, a model might associate the word "hot" with a negative sentiment because it frequently encounters the phrase "hot mess." A traditional explanation might falsely claim the model is using the concept of "weather" to decide a review is negative. In reality, removing the concept of "weather" would not change the model's prediction at all.

Illustration of the HI-concept task: identifying which human-understandable concepts (e.g., directing) actually impact the model's sentiment prediction versus those that are merely correlated (e.g., weather).

The HI-concept Framework

To bridge this gap, we introduce the HI-concept (High-Impact Concept) framework. This approach moves beyond simple patterns to identify the "causal" concepts driving predictions. The framework consists of three main components:

  1. Concept Extraction: High-level features are extracted from the hidden layer activations of a pre-trained model.
  2. Causality Loss: This is the core innovation. Instead of just finding patterns, the framework optimizes for features whose removal causes the output prediction to change substantially. We utilize a "do-operation" (borrowed from causal inference) to simulate the removal of a concept and measure the resulting "impact."
  3. Auto-encoding & Regularization: To ensure discovered concepts remain semantically meaningful, we use an auto-encoding loss to reconstruct original hidden states and a regularization loss to keep concepts distinct from one another.

Finally, visualization techniques like Grad-CAM are adapted to map these abstract internal concepts back to specific words or clusters that humans can interpret.

Experimental Evaluation

We evaluated HI-concept across three distinct data types: a Synthetic Toy Dataset designed to test spurious vs. causal features, the IMDB movie review dataset for sentiment classification, and the AG-News dataset for topic categorization.

Key Insights

  • The "Impact" Gap: Traditional methods like PCA or K-means often find concepts that are visually coherent to humans but have near-zero impact on the model's actual prediction. HI-concept successfully identifies the features that actually drive the output.
  • LLMs and Causal XAI: Larger, more complex models like Llama-7B benefit the most from this approach. Because these models are highly sensitive to subtle correlations, they are more prone to "spurious" reasoning that causal methods can effectively debunk.
  • Layer-wise Dynamics: Later layers in models like BERT tend to capture more "class-coherent" concepts (e.g., "Sports"), while earlier layers capture more abstract or lexical clusters (e.g., "Adjectives").

Key Results and Performance

Quantitative improvements were most dramatic on Large Language Models. We measured the "Accuracy Change" metric ($\Delta$Acc), which quantifies how much the model's accuracy drops when a concept is removed.

Comprehensive performance metrics across datasets and models. HI-concept significantly outperforms baselines in causality metrics (CACE and ΔAcc), particularly for the Llama model.

As shown in the results table, on the Llama model using the AG-News dataset, the $\Delta$Acc jumped from a baseline of 2.83% (ConceptSHAP) to 27.79% with HI-concept. On the IMDB dataset, the impact was even higher at 28.69%. Furthermore, HI-concept consistently achieved high faithfulness, meaning the simplified concept-based model could mimic the original complex LLM with high precision (often >90%).

A human study further validated these findings. In simulations where humans predicted model behavior, assistive information from HI-concept raised human prediction accuracy from 72.5% to 80.5%, with users reporting higher confidence and faster decision-making.

Limitations and Future Work

While HI-concept provides a powerful post-hoc explanation tool, it does not currently fix a model's internal biases during the initial training phase. Additionally, users must still choose the number of concepts to extract, which requires a balance between capturing nuance and avoiding noise. Future work will explore applying these causal objectives during training to prevent the learning of spurious correlations and extending the framework to domains like computer vision and tabular data.

Summary updated

BibTeX
@inproceedings{zhao2024explaining,
  author = {Ruochen Zhao and Tan Wang and Yongjie Wang and Shafiq Joty},
  title = {{Explaining Language Model Predictions with High-Impact Concepts}},
  booktitle = {EACL (Findings)},
  year = {2024},
  url = {https://openreview.net/forum?id=G99jLgad58},
}
Figure