{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/are-large-language-models-post-hoc-explainers","title":"In-Context Explainers: Harnessing LLMs for Explaining Black Box Models","arxiv_id":"2310.05797","date":"2023-10-09","proceeding":null,"authors":["Nicholas Kroeger","Dan Ley","Satyapriya Krishna","Chirag Agarwal","Himabindu Lakkaraju"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2310.05797v4","url_pdf":"https://arxiv.org/pdf/2310.05797v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"are-large-language-models-post-hoc-explainers","repo_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"xai","task_name":"Explainable Artificial Intelligence (XAI)"},{"task_slug":"explainable-artificial-intelligence","task_name":"Explainable artificial intelligence"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"machine-translation","task_name":"Machine Translation"}],"methods":[{"method_slug":"hoc","method_name":"HOC"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.05797","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.05797"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":9},"by_repo_kind":{"official":{"samples":9,"ran":9,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"d0bbb2c486d2619b","entry":"MakePostHocExplanations","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"generate_posthoc_explainers.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/generate_posthoc_explainers.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d0bbb2c486d2619b"}},{"code_sha256_prefix":"70a158439c9d1be0","entry":"bottom_k_indices","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"llms/icl.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/llms/icl.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70a158439c9d1be0"}},{"code_sha256_prefix":"293df5ab7abda673","entry":"compute_confidence","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"llms/icl.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/llms/icl.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"293df5ab7abda673"}},{"code_sha256_prefix":"4e9acdbea46f5706","entry":"generate_LLM_mask","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"faithulness_util.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/faithulness_util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4e9acdbea46f5706"}},{"code_sha256_prefix":"f4a2f984558ae1e9","entry":"generate_mask","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"faithulness_util.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/faithulness_util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f4a2f984558ae1e9"}},{"code_sha256_prefix":"83710f5fbef7cece","entry":"get_model_architecture","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"utils.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"83710f5fbef7cece"}},{"code_sha256_prefix":"8b4ea56e487a8d93","entry":"makeFakeRankMagnitudesForFaithfulnessCalculation","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"faithulness_util.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/faithulness_util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8b4ea56e487a8d93"}},{"code_sha256_prefix":"c49dffdd4082df08","entry":"shuffled_indices","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"utils.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c49dffdd4082df08"}},{"code_sha256_prefix":"9e844e7ad7120921","entry":"top_k_indices","repo":"AI4LIFE-GROUP/LLM_Explainer","repo_kind":"official","path":"llms/icl.py","file_url":"https://github.com/AI4LIFE-GROUP/LLM_Explainer/blob/HEAD/llms/icl.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9e844e7ad7120921"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}