{"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/attention-based-prototypical-learning-towards","title":"ProtoAttend: Attention-Based Prototypical Learning","arxiv_id":"1902.06292","date":"2019-02-17","proceeding":null,"authors":["Sercan O. Arik","Tomas Pfister"],"abstract":"We propose a novel inherently interpretable machine learning method that bases decisions on few relevant examples that we call prototypes. Our method, ProtoAttend, can be integrated into a wide range of neural network architectures including pre-trained models. It utilizes an attention mechanism that relates the encoded representations to samples in order to determine prototypes. The resulting model outperforms state of the art in three high impact problems without sacrificing accuracy of the original model: (1) it enables high-quality interpretability that outputs samples most relevant to the decision-making (i.e. a sample-based interpretability method); (2) it achieves state of the art confidence estimation by quantifying the mismatch across prototype labels; and (3) it obtains state of the art in distribution mismatch detection. All this can be achieved with minimal additional test time and a practically viable training time computational cost.","url_abs":"https://arxiv.org/abs/1902.06292v4","url_pdf":"https://arxiv.org/pdf/1902.06292v4.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":"attention-based-prototypical-learning-towards","repo_url":"https://github.com/ZJUHSY/2020-","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"attention-based-prototypical-learning-towards","repo_url":"https://github.com/aced125/sparsemax","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"attention-based-prototypical-learning-towards","repo_url":"https://github.com/google-research/google-research/tree/master/protoattend","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"attention-based-prototypical-learning-towards","repo_url":"https://github.com/si-qi/protoattend","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"decision-making","task_name":"Decision Making"},{"task_slug":"classification","task_name":"General Classification"},{"task_slug":"interpretable-machine-learning","task_name":"Interpretable Machine Learning"}],"methods":[{"method_slug":"interpretability","method_name":"Interpretability"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/1902.06292","atlas_url":"https://app.syntology.ai/?focus=1902.06292","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1902.06292"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/aced125/sparsemax","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google-research/google-research/tree/master/protoattend","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ZJUHSY/2020-","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/si-qi/protoattend","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":2,"ran_fixture":1,"unverified":1},"by_repo_kind":{"listed":{"samples":4,"ran":3,"repositories":3}},"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":1,"samples":[{"code_sha256_prefix":"32ac3d67805b2251","entry":"flatten_all_but_nth_dim","repo":"aced125/sparsemax","repo_kind":"listed","path":"sparsemax/utils.py","file_url":"https://github.com/aced125/sparsemax/blob/HEAD/sparsemax/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"32ac3d67805b2251"}},{"code_sha256_prefix":"ce92cc99dd76380b","entry":"relational_attention","repo":"ZJUHSY/2020-","repo_kind":"listed","path":"model.py","file_url":"https://github.com/ZJUHSY/2020-/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ce92cc99dd76380b"}},{"code_sha256_prefix":"bdec64ff3f52a1cc","entry":"unflatten_all_but_nth_dim","repo":"aced125/sparsemax","repo_kind":"listed","path":"sparsemax/utils.py","file_url":"https://github.com/aced125/sparsemax/blob/HEAD/sparsemax/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bdec64ff3f52a1cc"}},{"code_sha256_prefix":"ae96c336f5bbf25c","entry":"resnet_layer","repo":"si-qi/protoattend","repo_kind":"listed","path":"model.py","file_url":"https://github.com/si-qi/protoattend/blob/HEAD/model.py","link_basis":"harvester_set","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":"ae96c336f5bbf25c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}