{"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/contrastive-corpus-attribution-for-explaining","title":"Contrastive Corpus Attribution for Explaining Representations","arxiv_id":"2210.00107","date":"2022-09-30","proceeding":null,"authors":["Chris Lin","Hugh Chen","Chanwoo Kim","Su-In Lee"],"abstract":"Despite the widespread use of unsupervised models, very few methods are designed to explain them. Most explanation methods explain a scalar model output. However, unsupervised models output representation vectors, the elements of which are not good candidates to explain because they lack semantic meaning. To bridge this gap, recent works defined a scalar explanation output: a dot product-based similarity in the representation space to the sample being explained (i.e., an explicand). Although this enabled explanations of unsupervised models, the interpretation of this approach can still be opaque because similarity to the explicand's representation may not be meaningful to humans. To address this, we propose contrastive corpus similarity, a novel and semantically meaningful scalar explanation output based on a reference corpus and a contrasting foil set of samples. We demonstrate that contrastive corpus similarity is compatible with many post-hoc feature attribution methods to generate COntrastive COrpus Attributions (COCOA) and quantitatively verify that features important to the corpus are identified. We showcase the utility of COCOA in two ways: (i) we draw insights by explaining augmentations of the same image in a contrastive learning setting (SimCLR); and (ii) we perform zero-shot object localization by explaining the similarity of image representations to jointly learned text representations (CLIP).","url_abs":"https://arxiv.org/abs/2210.00107v2","url_pdf":"https://arxiv.org/pdf/2210.00107v2.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":"contrastive-corpus-attribution-for-explaining","repo_url":"https://github.com/suinleelab/cl-explainability","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"object-localization","task_name":"Object Localization"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2210.00107","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.00107"}},"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":"deterministic:regex_extraction","url":"https://github.com/suinleelab/cl-explainability","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Reza-Safdari/SimSiam-91","reach":{"status":"gone","observed_at":"2026-09-17","how":"tree_404+repo_404"}}],"summary":{"ran":3,"unverified":1},"by_repo_kind":{"official":{"samples":4,"ran":3,"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":"8ab14682d6c0d5ae","entry":"CorpusBasedExplanation","repo":"suinleelab/cl-explainability","repo_kind":"official","path":"src/cl_explain/explanations/contrastive_corpus_similarity.py","file_url":"https://github.com/suinleelab/cl-explainability/blob/HEAD/src/cl_explain/explanations/contrastive_corpus_similarity.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8ab14682d6c0d5ae"}},{"code_sha256_prefix":"c8a89c59ec6efff9","entry":"CorpusSimilarity","repo":"suinleelab/cl-explainability","repo_kind":"official","path":"src/cl_explain/explanations/contrastive_corpus_similarity.py","file_url":"https://github.com/suinleelab/cl-explainability/blob/HEAD/src/cl_explain/explanations/contrastive_corpus_similarity.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c8a89c59ec6efff9"}},{"code_sha256_prefix":"088e25d66d0978a3","entry":"ExplanationBase","repo":"suinleelab/cl-explainability","repo_kind":"official","path":"src/cl_explain/explanations/contrastive_corpus_similarity.py","file_url":"https://github.com/suinleelab/cl-explainability/blob/HEAD/src/cl_explain/explanations/contrastive_corpus_similarity.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"088e25d66d0978a3"}},{"code_sha256_prefix":"654b8ed7bf14f7c5","entry":"ContrastiveCorpusSimilarity","repo":"suinleelab/cl-explainability","repo_kind":"official","path":"src/cl_explain/explanations/contrastive_corpus_similarity.py","file_url":"https://github.com/suinleelab/cl-explainability/blob/HEAD/src/cl_explain/explanations/contrastive_corpus_similarity.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"654b8ed7bf14f7c5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}