Papers › In-Context Explainers: Harnessing LLMs for Explaining Black Box Models

In-Context Explainers: Harnessing LLMs for Explaining Black Box Models

9 Oct 2023arXiv:2310.05797archive 2025-07-28

Nicholas Kroeger, Dan Ley, Satyapriya Krishna, Chirag Agarwal, Himabindu Lakkaraju

Recent advancements in Large Language Models (LLMs) have demonstrated exceptional capabilities in complex tasks like machine translation, commonsense reasoning, and language understanding. One of the primary reasons for the adaptability of LLMs in such diverse tasks is their in-context learning (ICL) capability, which allows them to perform well on new tasks by simply using a few task samples in the prompt. Despite their effectiveness in enhancing the performance of LLMs on diverse language and tabular tasks, these methods have not been thoroughly explored for their potential to generate post hoc explanations. In this work, we carry out one of the first explorations to analyze the effectiveness of LLMs in explaining other complex predictive models using ICL. To this end, we propose a novel framework, In-Context Explainers, comprising of three novel approaches that exploit the ICL capabilities of LLMs to explain the predictions made by other predictive models. We conduct extensive analysis with these approaches on real-world tabular and text datasets and demonstrate that LLMs are capable of explaining other predictive models similar to state-of-the-art post hoc explainers, opening up promising avenues for future research into LLM-based post hoc explanations of complex predictive models.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2310.05797")

Code

Syntology Ran 9 of 9 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 9 ran with no contract checked.

By repository: official repository: 9 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

AI4LIFE-GROUP/LLM_Explainer officialmentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 9 ran; 0 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

9ran

Licence: 0 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from AI4LIFE-GROUP/LLM_Explainer. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

MakePostHocExplanations AI4LIFE-GROUP/LLM_Explainer/generate_posthoc_explainers.py official repository ran MIT (permissive) · d0bbb2c486d2619b · report
bottom_k_indices AI4LIFE-GROUP/LLM_Explainer/llms/icl.py official repository ran MIT (permissive) · 70a158439c9d1be0 · report
compute_confidence AI4LIFE-GROUP/LLM_Explainer/llms/icl.py official repository ran fingerprinted MIT (permissive) · 293df5ab7abda673 · report
generate_LLM_mask AI4LIFE-GROUP/LLM_Explainer/faithulness_util.py official repository ran MIT (permissive) · 4e9acdbea46f5706 · report
generate_mask AI4LIFE-GROUP/LLM_Explainer/faithulness_util.py official repository ran MIT (permissive) · f4a2f984558ae1e9 · report
get_model_architecture AI4LIFE-GROUP/LLM_Explainer/utils.py official repository ran MIT (permissive) · 83710f5fbef7cece · report
makeFakeRankMagnitudesForFaithfulnessCalculation AI4LIFE-GROUP/LLM_Explainer/faithulness_util.py official repository ran MIT (permissive) · 8b4ea56e487a8d93 · report
shuffled_indices AI4LIFE-GROUP/LLM_Explainer/utils.py official repository ran MIT (permissive) · c49dffdd4082df08 · report
top_k_indices AI4LIFE-GROUP/LLM_Explainer/llms/icl.py official repository ran MIT (permissive) · 9e844e7ad7120921 · report

Tasks

Explainable Artificial Intelligence (XAI)Explainable artificial intelligenceIn-Context LearningMachine Translation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

HOC

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections