LLiMe: Enhancing Text Classifier Explanations with Large Language Models

Abstract

Abstract The widespread diffusion of text black-box classifiers necessitates explainable AI (XAI) techniques for this domain. A seminal XAI technique is Local Interpretable Model-agnostic Explanations (LIME). For text classification, LIME maps an input sentence and its neighbours into a bag of words, using a linear regressor as an interpretable model. However, this strategy has significant limitations. Neighbouring sentences are constructed solely by extracting subsets of the input sentence, which may fail to accurately capture the local decision boundary. Moreover, these subsets are not guaranteed to be representative of the classification classes, potentially leading to unbalanced or misleading interpretability. Additionally, such generated sentences might lack semantic coherence. Furthermore, the resulting explanation is often limited to confirming the relevance of a term or highlighting the impact of its removal, without providing deeper insights. This work tries to overcome these limitations by proposing LLiMean extension of LIME that exploits advances in Large Language Models (LLMs) to perform a classifier-driven generation of the neighbourhood. Our approach allows neighbours to employ a vocabulary larger than that of the input text. A generation procedure is introduced to more effectively capture the local decision boundary by ensuring generated samples span all classes involved in the classification. Additionally, an LLM-driven explanation and a counterfactual generation procedure are presented, returning the most relevant set of editing operations to influence the black-box predictor’s decision. Thus, the approach provides a richer, easier-to-interpret explanation and high-quality counterfactuals compared to standard LIME. Experiments on real datasets witness the technique’s effectiveness in providing suitable, relevant, and interpretable explanations.

Cite

Text

Angiulli et al. "LLiMe: Enhancing Text Classifier Explanations with Large Language Models." Machine Learning, 2025. doi:10.1007/S10994-025-06920-Z

Markdown

[Angiulli et al. "LLiMe: Enhancing Text Classifier Explanations with Large Language Models." Machine Learning, 2025.](https://mlanthology.org/mlj/2025/angiulli2025mlj-llime/) doi:10.1007/S10994-025-06920-Z

BibTeX

@article{angiulli2025mlj-llime,
  title     = {{LLiMe: Enhancing Text Classifier Explanations with Large Language Models}},
  author    = {Angiulli, Fabrizio and De Luca, Francesco and Fassetti, Fabio and Nisticò, Simona},
  journal   = {Machine Learning},
  year      = {2025},
  pages     = {271},
  doi       = {10.1007/S10994-025-06920-Z},
  volume    = {114},
  url       = {https://mlanthology.org/mlj/2025/angiulli2025mlj-llime/}
}