Papers › How do Decisions Emerge across Layers in Neural Models? Interpretation with...

How do Decisions Emerge across Layers in Neural Models? Interpretation with Differentiable Masking

30 Apr 2020EMNLP 2020 11arXiv:2004.14992archive 2025-07-28

Nicola De Cao, Michael Schlichtkrull, Wilker Aziz, Ivan Titov

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.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2004.14992")

Code

Syntology Ran 6 of 10 code samples harvested from 2 repositories linked to this paper; 4 have no recorded run. Of those that ran: 6 ran with no contract checked.

By repository: official repository: 5 samples from 1 repository, 4 ran; community (archive-listed): 5 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

nicola-decao/diffmask officialmentioned in papermentioned on GitHubpytorch report
angelosnal/vision-diffmask mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 6 ran; 0 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

6ran
4unverified

Licence: 0 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

BinaryConcrete nicola-decao/diffmask/diffmask/models/gates.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 9d22095a17af9672 · report
DiffMaskGateInput nicola-decao/diffmask/diffmask/models/gates.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 42f456f21c831412 · report
MLPMaxGate nicola-decao/diffmask/diffmask/models/gates.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 6c897bca72237121 · report
Streched nicola-decao/diffmask/diffmask/models/gates.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 121b859bf1d3c812 · report
RectifiedStreched nicola-decao/diffmask/diffmask/models/gates.py official repository unverified MIT (permissive) · f8f0147cc5dfb672 · report
BinaryConcrete angelosnal/vision-diffmask/code/models/gates.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted MIT (permissive) · 6a5a019aa6eb2889 · report
RectifiedStreched angelosnal/vision-diffmask/code/models/gates.py community (archive-listed) ran · metamorphic tier: well formed MIT (permissive) · 1812ba7431095707 · report
DiffMaskGateInput angelosnal/vision-diffmask/code/models/gates.py community (archive-listed) unverified MIT (permissive) · ff21479d516498d0 · report
MLPMaxGate angelosnal/vision-diffmask/code/models/gates.py community (archive-listed) unverified MIT (permissive) · 746bf702c11c94f1 · report
Streched angelosnal/vision-diffmask/code/models/gates.py community (archive-listed) unverified MIT (permissive) · 71fdc59594de30ac · report

Tasks

PredictionQuestion AnsweringSentiment AnalysisSentiment Classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBERTDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionPruningResidual ConnectionSoftmaxWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections