Explaining Fine Tuned LLMs via Counterfactuals A Knowledge Graph Driven Framework
Not on the map. Why?
Abstract (arXiv)
The widespread adoption of Low-Rank Adaptation (LoRA) has enabled large language models (LLMs) to acquire domain-specific knowledge with remarkable efficiency. However, understanding how such a fine-tuning mechanism alters a model's structural reasoning and semantic behavior remains an open challenge. This work introduces a novel framework that explains fine-tuned LLMs via counterfactuals grounded in knowledge graphs. Specifically, we construct BioToolKG, a domain-specific heterogeneous knowledge graph in bioinformatics tools and design a counterfactual-based fine-tuned LLMs explainer (CFFTLLMExplainer) that learns soft masks over graph nodes and edges to generate minimal structural perturbations that induce maximum semantic divergence. Our method jointly optimizes structural sparsity and semantic divergence while enforcing interpretability preserving constraints such as entropy regularization and edge smoothness. We apply this framework to a fine-tuned LLaMA-based LLM and reveal that counterfactual masking exposes the model's structural dependencies and aligns with LoRA-induced parameter shifts. This work provides new insights into the internal mechanisms of fine-tuned LLMs and highlights counterfactual graphs as a potential tool for interpretable AI.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 26 of its 36 references that are in the map. First posted on arXiv 25 Sep 2025.
Builds on
26 of 36 references.
References · 26
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2017A Unified Approach to Interpreting Model Predictionscited by 6,555
- 2016"Why Should I Trust You?": Explaining the Predictions of Any Classifiercited by 5,070
- 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
- 2017Axiomatic Attribution for Deep Networkscited by 3,384
- 2023Retrieval-Augmented Generation for Large Language Models: A Surveycited by 2,212
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,407
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2023Language Models Don't Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Promptingcited by 1,122
- 2017Counterfactual Explanations without Opening the Black Box: Automated Decisions and the GDPRcited by 1,089
- 2019Attention is not Explanationcited by 929
14 more
- 2019Attention is not not Explanationcited by 636
- 2019Explaining Machine Learning Classifiers through Diverse Counterfactual Explanationscited by 614
- 2023Explainability for Large Language Models: A Surveycited by 333
- 2021Do Prompt-Based Models Really Understand the Meaning of their Prompts?cited by 326
- 2018Local Rule-Based Explanations of Black Box Decision Systemscited by 166
- 2024SaySelf: Teaching LLMs to Express Confidence with Self-Reflective Rationalescited by 105
- 2023Can Knowledge Graphs Reduce Hallucinations in LLMs? : A Surveycited by 92
- 2023Can Large Language Models Explain Themselves? A Study of LLM-Generated Self-Explanationscited by 90
- 2024Neural Exec: Learning (and Learning from) Execution Triggers for Prompt Injection Attackscited by 85
- 2020Domain-specific Knowledge Graphs: A surveycited by 68
- 2023Sequential Integrated Gradients: a simple but effective method for explaining language modelscited by 52
- 2019FOCUS: Flexible Optimizable Counterfactual Explanations for Tree Ensemblescited by 43
- 2024Concept Bottleneck Large Language Modelscited by 43
- 2024TokenSHAP: Interpreting Large Language Models with Monte Carlo Shapley Value Estimationcited by 42
Built on by
Not cited yet.