{"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/how-do-decisions-emerge-across-layers-in","title":"How do Decisions Emerge across Layers in Neural Models? Interpretation with Differentiable Masking","arxiv_id":"2004.14992","date":"2020-04-30","proceeding":"EMNLP 2020 11","authors":["Nicola De Cao","Michael Schlichtkrull","Wilker Aziz","Ivan Titov"],"abstract":"Attribution methods assess the contribution of inputs to the model prediction. One way to do so is erasure: a subset of inputs is considered irrelevant if it can be removed without affecting the prediction. Though conceptually simple, erasure's objective is intractable and approximate search remains expensive with modern deep NLP models. Erasure is also susceptible to the hindsight bias: the fact that an input can be dropped does not mean that the model `knows' it can be dropped. The resulting pruning is over-aggressive and does not reflect how the model arrives at the prediction. To deal with these challenges, we introduce Differentiable Masking. DiffMask learns to mask-out subsets of the input while maintaining differentiability. The decision to include or disregard an input token is made with a simple model based on intermediate hidden layers of the analyzed model. First, this makes the approach efficient because we predict rather than search. Second, as with probing classifiers, this reveals what the network `knows' at the corresponding layers. This lets us not only plot attribution heatmaps but also analyze how decisions are formed across network layers. We use DiffMask to study BERT models on sentiment classification and question answering.","url_abs":"https://arxiv.org/abs/2004.14992v3","url_pdf":"https://arxiv.org/pdf/2004.14992v3.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":"how-do-decisions-emerge-across-layers-in","repo_url":"https://github.com/nicola-decao/diffmask","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"how-do-decisions-emerge-across-layers-in","repo_url":"https://github.com/angelosnal/vision-diffmask","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"prediction","task_name":"Prediction"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"sentiment-analysis","task_name":"Sentiment Analysis"},{"task_slug":"sentiment-classification","task_name":"Sentiment Classification"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"pruning","method_name":"Pruning"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2004.14992","atlas_url":"https://app.syntology.ai/?focus=2004.14992","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.14992"}},"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/angelosnal/vision-diffmask","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nicola-decao/diffmask","reach":null}],"summary":{"ran":6,"unverified":4},"by_repo_kind":{"official":{"samples":5,"ran":4,"repositories":1},"listed":{"samples":5,"ran":2,"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":"9d22095a17af9672","entry":"BinaryConcrete","repo":"nicola-decao/diffmask","repo_kind":"official","path":"diffmask/models/gates.py","file_url":"https://github.com/nicola-decao/diffmask/blob/HEAD/diffmask/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9d22095a17af9672"}},{"code_sha256_prefix":"6a5a019aa6eb2889","entry":"BinaryConcrete","repo":"angelosnal/vision-diffmask","repo_kind":"listed","path":"code/models/gates.py","file_url":"https://github.com/angelosnal/vision-diffmask/blob/HEAD/code/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6a5a019aa6eb2889"}},{"code_sha256_prefix":"42f456f21c831412","entry":"DiffMaskGateInput","repo":"nicola-decao/diffmask","repo_kind":"official","path":"diffmask/models/gates.py","file_url":"https://github.com/nicola-decao/diffmask/blob/HEAD/diffmask/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"42f456f21c831412"}},{"code_sha256_prefix":"6c897bca72237121","entry":"MLPMaxGate","repo":"nicola-decao/diffmask","repo_kind":"official","path":"diffmask/models/gates.py","file_url":"https://github.com/nicola-decao/diffmask/blob/HEAD/diffmask/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6c897bca72237121"}},{"code_sha256_prefix":"1812ba7431095707","entry":"RectifiedStreched","repo":"angelosnal/vision-diffmask","repo_kind":"listed","path":"code/models/gates.py","file_url":"https://github.com/angelosnal/vision-diffmask/blob/HEAD/code/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1812ba7431095707"}},{"code_sha256_prefix":"121b859bf1d3c812","entry":"Streched","repo":"nicola-decao/diffmask","repo_kind":"official","path":"diffmask/models/gates.py","file_url":"https://github.com/nicola-decao/diffmask/blob/HEAD/diffmask/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"121b859bf1d3c812"}},{"code_sha256_prefix":"ff21479d516498d0","entry":"DiffMaskGateInput","repo":"angelosnal/vision-diffmask","repo_kind":"listed","path":"code/models/gates.py","file_url":"https://github.com/angelosnal/vision-diffmask/blob/HEAD/code/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ff21479d516498d0"}},{"code_sha256_prefix":"746bf702c11c94f1","entry":"MLPMaxGate","repo":"angelosnal/vision-diffmask","repo_kind":"listed","path":"code/models/gates.py","file_url":"https://github.com/angelosnal/vision-diffmask/blob/HEAD/code/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"746bf702c11c94f1"}},{"code_sha256_prefix":"f8f0147cc5dfb672","entry":"RectifiedStreched","repo":"nicola-decao/diffmask","repo_kind":"official","path":"diffmask/models/gates.py","file_url":"https://github.com/nicola-decao/diffmask/blob/HEAD/diffmask/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f8f0147cc5dfb672"}},{"code_sha256_prefix":"71fdc59594de30ac","entry":"Streched","repo":"angelosnal/vision-diffmask","repo_kind":"listed","path":"code/models/gates.py","file_url":"https://github.com/angelosnal/vision-diffmask/blob/HEAD/code/models/gates.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71fdc59594de30ac"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}