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:
- 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.
- 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.
- 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.
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.
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