Multi-Level Explanations for Generative Language Models

Lucas Monteiro Paes, Dennis Wei, Hyo Jin Do, Hendrik Strobelt, Ronny Luss, Amit Dhurandhar, Manish Nagireddy, Karthikeyan Natesan Ramamurthy, Prasanna Sattigeri, Werner Geyer, Soumya Ghosh

Abstract

As Large Language Models (LLMs) are increasingly deployed for context-grounded tasks, understanding the relationship between input context and generated output becomes critical. This paper introduces MExGen (Multi-Level Explanations for Generative Language Models), a framework designed to provide faithful and computationally efficient attributions for generative outputs. By employing a hierarchical refinement strategy and "scalarizers" to handle text-only outputs, MExGen overcomes the limitations of traditional attribution methods in the generative domain.

Introduction

The "black box" nature of LLMs poses significant risks in high-stakes domains like legal or medical summarization. Users require transparency regarding which parts of an input document influenced a specific summary or answer. Traditional attribution methods like LIME or SHAP face three primary hurdles when applied to LLMs: the lack of numerical output scores (probabilities), the high cost of repeated model inference, and the computational complexity of processing long input contexts.

Methodology: The MExGen Framework

MExGen addresses these challenges through three core innovations:

  1. Scalarizers: To interpret raw text outputs, MExGen uses scalarizers—functions such as BERTScore or BARTScore—that map the semantic similarity between original and perturbed outputs to a real number. This allows the application of mathematical attribution frameworks to proprietary, text-only APIs.
  2. Linguistic Segmentation & Multi-Level Attribution: Instead of a flat token-level analysis, MExGen utilizes a coarse-to-fine approach. It first identifies significant sentences and then "zooms in" to attribute importance to specific phrases or words within those sentences.
  3. Efficient Algorithms: The framework introduces C-LIME and L-SHAP, variants designed to scale linearly with the number of input units, significantly reducing the number of required model queries.
The MExGen workflow: from text input to multi-level attribution scores.

Experimental Evaluation

The framework was evaluated on summarization (XSUM, CNN/Daily Mail) and question-answering (SQuAD) tasks. Testing spanned several models, including Llama-3, DeepSeek-V3, and Granite-3.3.

Key Results and Fidelity

MExGen consistently outperformed baselines like PartitionSHAP and CaptumLIME. Performance was measured using the Area Under the Perturbation Curve (AUPC), where a higher score indicates that the method successfully identified tokens whose removal significantly impacts model output quality.

Scalarizer Robustness

A critical finding was the robustness of text-only scalarizers. Spearman correlation analysis revealed that metrics like BERTScore and BARTScore are highly correlated with each other and with internal model log probabilities. Interestingly, human evaluators often found BERT-based explanations more intuitive and faithful to their own reasoning than those based on raw probabilities.

Spearman correlation matrices for MExGen C-LIME and L-SHAP across different scalarizers.

Discussion and Insights

  • External vs. Self-Explanation: MExGen's external attribution proved more faithful to model behavior than the models' own self-explanations.
  • Semantic Alignment: The success of semantic metrics suggests that human-interpretable similarity aligns better with the logic of generative models than internal mathematical weights in many contexts.
  • Hierarchical Efficiency: The multi-level approach effectively mitigates the "curse of dimensionality" for long-form documents.

Conclusion

MExGen provides a scalable, post-hoc solution for explaining generative model outputs. While it significantly improves efficiency, the method remains a local explanation tool and requires multiple inferences. Future research may explore word infilling and deeper hierarchical structures to further enhance explanation quality.

Summary updated

BibTeX
@inproceedings{paes2025multi,
  author = {Lucas Monteiro Paes and Dennis Wei and Hyo Jin Do and Hendrik Strobelt and Ronny Luss and Amit Dhurandhar and Manish Nagireddy and Karthikeyan Natesan Ramamurthy and Prasanna Sattigeri and Werner Geyer and Soumya Ghosh},
  title = {{Multi-Level Explanations for Generative Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure