{"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/latent-concept-based-explanation-of-nlp","title":"Latent Concept-based Explanation of NLP Models","arxiv_id":"2404.12545","date":"2024-04-18","proceeding":null,"authors":["Xuemin Yu","Fahim Dalvi","Nadir Durrani","Marzia Nouri","Hassan Sajjad"],"abstract":"Interpreting and understanding the predictions made by deep learning models poses a formidable challenge due to their inherently opaque nature. Many previous efforts aimed at explaining these predictions rely on input features, specifically, the words within NLP models. However, such explanations are often less informative due to the discrete nature of these words and their lack of contextual verbosity. To address this limitation, we introduce the Latent Concept Attribution method (LACOAT), which generates explanations for predictions based on latent concepts. Our foundational intuition is that a word can exhibit multiple facets, contingent upon the context in which it is used. Therefore, given a word in context, the latent space derived from our training process reflects a specific facet of that word. LACOAT functions by mapping the representations of salient input words into the training latent space, allowing it to provide latent context-based explanations of the prediction.","url_abs":"https://arxiv.org/abs/2404.12545v3","url_pdf":"https://arxiv.org/pdf/2404.12545v3.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":"latent-concept-based-explanation-of-nlp","repo_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.12545","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.12545"}},"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/xuemin-yu/eraser_movie_latentconcept","reach":{"status":"ok"}}],"summary":{"ran":14,"unverified":1},"by_repo_kind":{"official":{"samples":15,"ran":14,"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":15,"samples":[{"code_sha256_prefix":"25b8350702132a9d","entry":"casing_preprocess","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/clustering/align_with_auto_tags.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/clustering/align_with_auto_tags.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"25b8350702132a9d"}},{"code_sha256_prefix":"6339ec10df36c250","entry":"decision_fn_max_score","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/clustering/align_with_auto_tags.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/clustering/align_with_auto_tags.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6339ec10df36c250"}},{"code_sha256_prefix":"b9034e0f8f83d734","entry":"decision_fn_ngram","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/clustering/align_with_auto_tags.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/clustering/align_with_auto_tags.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b9034e0f8f83d734"}},{"code_sha256_prefix":"fa5d52299d5d9650","entry":"format_predictions","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/logistic_regression.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/logistic_regression.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fa5d52299d5d9650"}},{"code_sha256_prefix":"cd915738179945fd","entry":"gen_table","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/clustering/align_with_single_auto_tag.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/clustering/align_with_single_auto_tag.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cd915738179945fd"}},{"code_sha256_prefix":"a2fa23c0d48719d9","entry":"load_clusters","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/generate_csv_file.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/generate_csv_file.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a2fa23c0d48719d9"}},{"code_sha256_prefix":"c25289c69d75070e","entry":"load_dataset","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/generate_csv_file.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/generate_csv_file.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c25289c69d75070e"}},{"code_sha256_prefix":"b83fa5669f72c171","entry":"mapping_tokens_with_cluster_idx","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/generate_csv_file.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/generate_csv_file.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b83fa5669f72c171"}},{"code_sha256_prefix":"f233a7d5a84d22fb","entry":"read_csv","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/get_prediction_stats.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/get_prediction_stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f233a7d5a84d22fb"}},{"code_sha256_prefix":"0d5b1e57d0e3c988","entry":"read_csv","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/split_dataset.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/split_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0d5b1e57d0e3c988"}},{"code_sha256_prefix":"1d95d4546246c8f0","entry":"read_data","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/clustering/format_to_tsv.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/clustering/format_to_tsv.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1d95d4546246c8f0"}},{"code_sha256_prefix":"b3b80ada235a5597","entry":"read_ids","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/split_dataset.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/split_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b3b80ada235a5597"}},{"code_sha256_prefix":"eb96f8c05768ff87","entry":"split_dataset","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/split_dataset.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/split_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"eb96f8c05768ff87"}},{"code_sha256_prefix":"65765821d1790f91","entry":"train_classifier","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/logistic_regression.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/logistic_regression.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"65765821d1790f91"}},{"code_sha256_prefix":"0d0b2efe4922d323","entry":"validate_classifier","repo":"xuemin-yu/eraser_movie_latentconcept","repo_kind":"official","path":"src/classifier_mapping/logistic_regression.py","file_url":"https://github.com/xuemin-yu/eraser_movie_latentconcept/blob/HEAD/src/classifier_mapping/logistic_regression.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0d0b2efe4922d323"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}