Elamur Research

Right for the Right Reasons: Training Differentiable Models by Constraining their Explanations

Paper · 2017 · Andrew Slavin Ross, Michael C. Hughes and Finale Doshi‐Velez

Summary

A classifier can perform well in training and still be unprepared for the conditions in which it will be used. In the paper’s digit experiment, the researchers put a gray patch in a corner of each image. During training, its shade gives away the digit. At test time, the shade is random. A network that has learned to read the patch now faces a task it was never rewarded for mastering on its own. The authors ask how to detect a dependence like this and how to change it once it has been found.

Their approach to interpretability starts with a quantity that can be calculated directly from a differentiable classifier. An input gradient measures how quickly an output changes when an input coordinate changes slightly. A gradient display can show where the network is sensitive, and the same kind of derivative can enter the training objective. An expert marks coordinates that should have little influence for a given example. The network still has to predict the labels, but it now also pays a penalty for reacting strongly at the marked locations. The expert can object to a cue without supplying a complete rule for making the prediction.

In a synthetic color task with competing rules, ordinary training repeatedly settles on the corners. Penalizing sensitivity there shifts the network toward a rule based on the top row. The authors also construct misleading associations in digit images and in a dataset assembled from flower and cancer measurements. Explanation constraints recover predictive performance when the artificial cue is randomized or the misleading features are withheld. As a way of diagnosing dependencies, gradients frequently highlight the same evidence as LIME, which explains a prediction by trying altered inputs. Gradients require much less computation in these experiments and reveal a tabular dependency that LIME misses. LIME can better convey the visual importance of a digit as a whole.

The paper also explores what to do when nobody has marked the misleading features. It takes the strongest sensitivities of a trained classifier and penalizes those locations in a subsequent run. Repeating the process yields alternatives for inspection, some of which handle the changed digit and tabular test conditions better. The search gives an expert candidates to compare, and the gradient gives a precise account of each candidate’s reaction to small changes. Judging whether the evidence is appropriate still requires knowledge of the task and, where possible, tests that change the conditions the classifier will face.

Deep dive: Right for the Right Reasons: Training Differentiable Models by Constraining their Explanations

How training with input gradient penalties can steer classifiers away from misleading cues and improve accuracy when those cues fail at test time. · about 35 minutes to read

The problem and its context

When the recorded outcome has more than one explanation

A training example pairs observations with a desired answer. The answer guides the learning algorithm towards functions that make the observed predictions, leaving room for those functions to depend on very different parts of the observations. If the same features tend to occur together throughout the available data, an evaluation under the same conditions can give those functions similar scores. The difference becomes consequential when the features stop occurring together. The paper studies this ambiguity as a problem in supervised machine learning.

The authors motivate the problem with earlier research on hospital readmission after pneumonia. The data described people who had already been hospitalized for the illness. In the observed records, asthma appeared to indicate a lower chance of readmission. Yet asthma made pneumonia patients medically more vulnerable. They had also received better initial care, so their recorded outcomes reflected treatment decisions as well as their underlying condition. A predictor could pick up a relationship that held in those records and give dangerous guidance if it were subsequently used to prioritize care.

The example clarifies what the authors mean by a reason. A classifier has an implicit rule that takes it from measurements to a decision, even when it never states that rule in words. An explanation conveys reliable information about that rule for a prediction. Accuracy is measured by the answers that agree with the labels. The stronger standard proposed in the paper also asks whether the rule travels to the conditions of interest and whether it makes sense to people who understand the domain. A frequent association in a dataset may require an explanation of its own before it is suitable evidence for a decision.

This problem persists even if the learning algorithm does its usual job well. A classifier might use a genuine characteristic of an object, a detail of the way the image was prepared, or a mixture of the two. An accuracy score summarizes the outputs over the examples that happened to be tested. When preparation and object identity are associated throughout those examples, the score gives little leverage for telling those possibilities apart. The missing information is about what should happen when a particular part of the input varies.

What conventional restrictions can express

Learning systems already have ways of preferring some solutions over others. The paper mentions encouraging sparse parameters or keeping parameter values small. It also describes architectural choices that reflect domain knowledge, such as using convolutional structure to accommodate spatial transformations. Each narrows the search in a way that can make a learned rule more transferable.

The concern here is that the preference has to reach the particular association at issue. A small parameter can still contribute to a rule that confuses provision of care with the severity of illness. A spatially structured classifier can still find a conspicuous image artifact. Parameter penalties express a preference about the function through the values that implement it, while the feedback considered in this paper comes in a different form. A reviewer might be able to specify a change in the input that should have little effect on a decision. That is a statement about observable behavior in a particular situation.

High-dimensional inputs give this distinction practical importance. The paper’s concern is with datasets that offer multiple ways to predict the same labels. Some of those ways can be hard to discover through ordinary training, even when the network could express them. An expert may also know only part of what an acceptable rule looks like. Knowing why a measurement should be disregarded can be enough to direct the search, even when the expert cannot give a full description of how the remaining measurements should be combined.

From looking at predictions to constraining them

The earlier work discussed in the paper includes several ways to explain a decision by examining nearby alternatives. In a local counterfactual explanation, the question is how the output responds when the specific example changes. A reader might ask whether taking away part of a document would lower support for its predicted category. The relevant change can depend on the domain and on how the classifier represents a document. The paper places work on removing parts of a representation and identifying textual rationales in this area. Representation Erasure and Rationalizing Neural Predictions.

LIME applies the general idea by evaluating the classifier on altered versions of the input. It fits a simple predictor to describe the outputs in that neighborhood, using a small set of features to make the result readable. This works through the classifier’s responses to queries, so it can be used without differentiating its internals. For a single prediction, a reviewer can get a short account of what the fitted explanation says matters. Repeating the sampling, prediction, and fitting for many examples at each stage of training would impose a much larger cost. LIME.

A differentiable classifier already supplies a different local description. Its derivatives give the rates of change of its outputs in the input coordinates. The authors situate this idea in earlier work on visualizing image and language networks. They also cite work on double back-propagation, which had shown benefits from penalizing input gradient magnitudes as a general regularizer. The new use is to direct the penalty at sensitivities identified by an explanation and to use it to find competing rules. Deep Inside Convolutional Networks and Visualizing Neural Networks in NLP.

Expert feedback about evidence also predates the paper. The authors mention rationale-based methods for support vector machines and particular text architectures, along with earlier work on rationales for visual recognition. These approaches show how a trainer can learn from what an annotator says about individual examples in addition to their labels. The gap the authors identify is a general training procedure for differentiable classifiers in which the same kind of information the classifier supplies as an explanation can be used to revise its behavior. Annotator Rationales for Text Categorization.

The paper distinguishes the reliability of an explanation from how readily a person can use it. A short, familiar-looking account can leave out an important dependency. A mathematically direct description can be difficult to read if the inputs are numerous or hard to name. The authors cite work on the difficulty of evaluating interpretability and build their own comparisons around observable behavior, such as how a prediction changes near an example or how accuracy changes when information is withheld. Towards a Rigorous Science of Interpretable Machine Learning.

The method, step by step

Give the learner a narrower objection

Imagine seeing a gradient display for a digit with a patch in its corner. The different positions in the display correspond to coordinates the classifier can see. If changing the shade slightly has a strong effect on the output, the display can flag the patch. A reviewer who knows how the patch got there can say that its pixels should have little influence. There is no need to specify how the network should recognize each stroke, or how much every other pixel should matter.

The authors train with that objection alongside the label. For each example, the learning procedure calculates the output and the input sensitivities. It charges the classifier for large sensitivities where the reviewer has marked the input. Because both the prediction and the sensitivity depend on the trainable weights, an update can act on both. The marked pixels remain visible. How much their influence shrinks depends on the relative cost of relying on them and of making classification errors.

This setup also works with partial feedback. One example can carry a mask for the upper-left corner and another a mask for a different corner. Examples for which there is no judgment can still contribute their labels. The mask describes where an objection applies in the representation the classifier actually uses. It can be identical across examples if the same measurements are suspect throughout the data.

Training with selective input gradient penalties

The steps in order.

Training with selective input gradient penaltiesStep 1: Pair training inputs with class labels1. Pair training inputs with class labelsStep 2: Mark irrelevant coordinates for selected examples2. Mark irrelevant coordinates for selected examplesStep 3: Calculate class probabilities and input gradients3. Calculate class probabilities and input gradientsStep 4: Square the sensitivities at marked coordinates4. Square the sensitivities at marked coordinatesStep 5: Add the penalty to the classification loss5. Add the penalty to the classification lossStep 6: Update weights using the combined objective6. Update weights using the combined objective

Represent observations, predictions, and local changes

The paper writes the entire set of feature vectors as a matrix.

X ∈ ℝ^(N×D)

Here, X holds the input features, and ∈ means membership in the indicated space of real-valued matrices, written with ℝ. N is the number of examples, D is the number of coordinates in each example, and × gives the row and column dimensions. In the image experiments those coordinates describe pixels or channels. In the text experiment they are vocabulary features. Xₙ denotes the row for example n, and xₙd is its entry at feature index d.

ŷ = f(X | θ) ∈ ℝ^(N×K)

The symbol ŷ denotes the matrix of predictions, with a row for each input and a column for each of the K possible classes. The function f is the classifier, and the vertical bar indicates that its behavior depends on the trainable parameters θ. The entry ŷₙₖ is the probability given to class k on example n. The label matrix y has the same dimensions. Its entries are one-hot, meaning the true class has entry 1 and the other classes have entry 0.

For a selected class output, the local explanation has the same coordinate layout as the input row.

∇_(Xₙ) ŷₙₖ = (∂ŷₙₖ/∂xₙd)_(d=1,…,D)

The operator ∇ takes a gradient with respect to the coordinates of Xₙ. Each partial derivative, written with ∂, varies the indicated coordinate xₙd locally while the other coordinates are fixed. The parentheses collect the entries indexed by d from 1 through D, with the ellipsis indicating the intervening indices. The sign tells whether increasing a coordinate locally raises or lowers the chosen probability. Magnitude tells how rapidly it does so on the input scale. A class probability supplies a gradient vector, and inspecting several class outputs can supply several such vectors. The paper uses f_X for input derivatives.

Geometrically, the gradient of a scalar output is perpendicular to a local contour on which that output is constant. Near a simple class boundary, that gives a way to see which directions lead across the boundary. The paper illustrates this with small two-dimensional problems. The ordinary probability gradients are most pronounced near the boundaries in those illustrations, while derivatives of log probabilities remain informative over more of the regions where a class wins. The plots make visible why a local derivative can reveal a feature dependency even though the classifier’s full decision surface is complicated.

There is a useful distinction between the mathematical operation and the way a person reads the result. A large derivative on a background pixel could mean that lightening it would start to extend a stroke in a way that changes the class probability. The background pixel need never have contained visible ink in the original. A display of local sensitivities can accordingly highlight coordinates where a small change would create evidence, as well as coordinates where it would disturb evidence already present.

Specify where low sensitivity is desired

The feedback takes the form of a binary array aligned with X.

A ∈ {0, 1}^(N×D)

A is the annotation matrix. The braces give the two possible values for an entry. Its row n applies to example n, and column d applies to the same feature coordinate as column d of X. An entry Aₙd of 1 asks the training procedure to make the prediction locally insensitive to that feature on that example. An entry of 0 leaves the coordinate free of the explanation penalty. A row containing only zeros is sufficient to represent an example with no feedback.

The authors choose to shrink the unwanted derivatives. Requiring large derivatives at desired locations would imply that even a clearly recognizable digit should respond strongly to tiny changes in the strokes that make it recognizable. Saturation in a confident region can make such a requirement inappropriate. There is also no general target magnitude supplied by the annotator. A mark on an irrelevant coordinate expresses a more limited demand, with little local response as the desired behavior.

The row structure matters when a feature has a useful interpretation in one context and an incidental association in another. A permanent ban would apply to both contexts. By annotating individual rows, the objective can express different judgments about the same column. The authors also point out that a derivative makes it possible to express this preference without designing a way to replace or perturb each kind of feature. The mask identifies what to constrain, and differentiation supplies the local operation used to measure it.

Combine fit, sensitivity, and parameter size

The complete objective is a sum of the classification cost, the masked gradient penalty, and a conventional parameter penalty.

L(θ, X, y, A) =
    ∑_(n=1)^N ∑_(k=1)^K −yₙₖ log(ŷₙₖ)
  + λ₁ ∑_(n=1)^N ∑_(d=1)^D (Aₙd · ∂[∑_(k=1)^K log(ŷₙₖ)]/∂xₙd)²
  + λ₂ ∑ᵢ θᵢ²

L is the loss minimized over the parameters θ, given the inputs X, labels y, and mask A. Each ∑ adds contributions over its indicated index. In the first term, n ranges over the N examples and k over the K classes. The minus sign makes low probability for the true class costly. Because yₙₖ gives the one-hot label and ŷₙₖ the predicted probability, only the log probability of the true class contributes to the classification cost for each row. The operation log is the logarithm. This part of the loss is cross-entropy.

In the middle term, d ranges over the D input coordinates. The expression inside square brackets adds the log probabilities of all classes for the current example. Its partial derivative with respect to xₙd gives the sensitivity of that sum. The dot denotes multiplication by the corresponding entry of A. Any coordinate with a zero entry contributes zero. The exponent ² squares the selected derivative, so a strongly negative response costs as much as a strongly positive response. The weight λ₁ determines how much the resulting sum matters in training.

In the last term, i indexes the individual trainable parameters θᵢ. Squaring them and summing gives the usual squared parameter penalty, weighted by λ₂. This term can remain active with an empty annotation matrix. With every annotation entry set to 1, the middle term becomes a broad penalty on input sensitivity to the chosen scalar output. The cases between these extremes allow a particular feature or group of features to be discouraged while other input sensitivities develop in response to the labels.

The order of operations in the middle term is important. The authors differentiate a sum of log probabilities and then square the result at the marked coordinate. This lets derivatives from different class terms offset each other. The quantity being constrained is a particular summary of the output distribution. It is distinct from taking the derivatives of all the class outputs individually and squaring each before adding them. The paper’s visualizations often show probability derivatives instead, so the displayed map and the training objective can use different scalar quantities.

The authors tried penalizing the gradient of the predicted class’s log probability as an alternative. That quantity follows whichever class currently has the highest probability. When the winning class changes, the objective can switch abruptly between class gradients. The authors suggest this as a reason that summing the log probabilities produced somewhat steadier behavior, although the alternatives performed comparably. They leave individual class-specific constraints for future investigation.

Train the classifier and choose the weight of the objection

The optimizer must calculate how the combined loss changes with θ. In the explanation term, that entails differentiating through a derivative already taken with respect to the input. Computing an explanation for a fixed classifier and training the classifier with that explanation thus involve different calculations. The former needs the input derivative. The latter needs its dependence on the weights so that an update can make the marked sensitivity smaller.

The experiments use a multilayer perceptron whose hidden layers have sizes 50 and 30. Each hidden layer uses rectified linear activations, or ReLUs, which pass positive values through and set negative ones to zero. A softmax output converts the final scores into class probabilities. The authors use Autograd for differentiation and train in batches of 256 examples using Adam. The parameter coefficient λ₂ is 0.0001, and in most experiments the explanation coefficient λ₁ is 1000. The authors make their experimental code available in a repository named rrr.

The appendix describes how the authors choose the explanation weight when a validation set may share the training confound. Selecting it on validation accuracy alone could favor a classifier that uses the suspect feature. The authors instead compare the sizes of the cross-entropy and the weighted explanation term. Their target is roughly comparable magnitudes, with room for the classification objective to keep exerting pressure while the mask has enough influence to redirect the rule. This is a heuristic grounded in the experiments. Its consequences can be seen by comparing what happens at different penalty strengths.

Construct objections from an earlier explanation

The paper calls its second procedure find-another-explanation. Its starting point is the classifier obtained with labels and ordinary parameter regularization. The first mask is empty.

A₀ = 0

A₀ is the mask for the initial run. The subscript identifies its position in the sequence, and 0 denotes an array in which every entry is zero.

θ₀ = argmin_θ L(θ, X, y, A₀)

Here, θ₀ is the learned parameter set for that run. The expression argmin denotes the parameter choice sought by minimizing L over θ. X and y still specify the training examples and labels, and A₀ is held fixed during this training. The notation describes the objective of the optimizer. The later runs seek solutions to their respective objectives in the same way.

The procedure explains the training observations with the resulting classifier and masks the coordinates with large relative gradient magnitudes.

A₁ = M_c[f_X | θ₀]

A₁ is the mask used in the next run. The bracketed expression abbreviates the collection of input gradients f_X for X at the weights θ₀. The operation M_c marks a component if the ratio of its magnitude to the largest component magnitude reaches the threshold c. Magnitudes use absolute values, so a strong response in either direction can be selected. The paper often uses c equal to 0.67, which tended to retain 2-5% of the components. The criterion compares magnitude with a maximum. The fraction of entries selected can therefore vary with the shape of the explanation.

θ₁ = argmin_θ L(θ, X, y, A₁)

The parameter set θ₁ is the result sought by minimizing the loss with the newly derived mask A₁. Training still uses the original labels in y. A feature marked by the previous explanation now carries a cost for local sensitivity, so the optimizer has a reason to use other available information.

A₂ = M_c[f_X | θ₁] ∪ A₁

A₂ is the mask for the following fit. The union sign ∪ keeps a coordinate marked if either the mask from the newest classifier at θ₁ or the preceding mask A₁ marks it. The operation accumulates positions separately for the training examples. It increases the set of previously implicated input coordinates at which sensitivity will be discouraged.

θ₂ = argmin_θ L(θ, X, y, A₂)

The symbol θ₂ denotes the next parameters sought with A₂ fixed. Further rounds repeat the pattern of explaining, adding marked locations to the accumulated mask, and fitting a classifier with the updated objective. The mask generated at each step expresses a desire to explore a different rule. Its entries come from evidence about the previous classifier’s sensitivities, without a judgment that those sensitivities were intrinsically inappropriate.

The authors look for signs of diminishing returns. Accuracy can drop, explanations can stop changing substantially, or a much larger λ₁ can become necessary to see further movement. An expert can inspect the candidates while they still give useful predictions. The authors also suggest looking first at examples on which the candidates disagree. Those disagreements are occasions where having several plausible rules makes a practical difference to the output.

Experiments and results

What is measured

The experiments ask whether gradients reveal recognizable dependencies, whether the loss can redirect those dependencies, and whether doing so allows a classifier to handle a change between training and test. The same general perceptron architecture is used across a synthetic image task and variants of text, tabular, and digit datasets. Predictive performance is measured by accuracy, the share of examples assigned the correct class. Explanations are compared by which features they identify, how the features are weighted or signed, and how those indications agree with known properties of the data.

The comparisons serve different purposes. A LIME display is a baseline for diagnosing a trained network. An unrestricted training run is a baseline for the effect of the mask. A test set with a missing or randomized cue then checks why the change in sensitivity matters. This last comparison gives the accuracy score a more specific interpretation. The intervention changes the availability or usefulness of the evidence the explanation identifies.

Toy Color gives the learner competing visual rules

The authors generate RGB images of size 5 × 5 × 3 using four colors. In class 1, the four corners match one another, and the three pixels at the top middle have distinct colors. In class 2, neither condition holds. The class design means that either region provides a way to classify these images. An explanation can be checked against known positions because the researchers themselves specified the rules.

Gradient displays and LIME both point to the corners in the examples from ordinary training. The authors report that the same preference recurs across random starts. This is informative because the alternative rule is already supported by the images. The repeated corner solution reveals a preference of the training setup, while the labels are compatible with the top-middle rule as well.

Marking the corners in the annotation matrix and training with the penalty changes the learned sensitivities toward the top-middle pixels. The number of marked examples and the strength assigned to their explanation loss both affect that transition. In the ordinary annotation arrangement, the authors describe using on the order of 10³ marked examples, or 5% of the dataset, for the switch. When they ensure the presence of annotated examples in Adam minibatches, consistent switching is reported with 50 examples, or 0.2% of the dataset.

The automatic mask yields a similar initial change. It detects the strong corner derivatives and uses them to guide the next run towards the already available top-middle rule. Once both useful regions have been targeted, explanations become noisy and performance falls to the level of random guessing. The authors qualify that final result because obtaining it required a very strong penalty. The initial switch provides the more direct evidence that the procedure can expose an alternative rule without being told its location.

20 Newsgroups exposes word-level associations

The language experiment concerns the alt.atheism and soc.religion.christian categories from 20 Newsgroups. A document is represented with 5000 components of TF-IDF, a weighting of vocabulary features based on their use in the document and their prevalence in the collection. For the run with no marked explanation coordinates, the paper reports 94% accuracy and gives no split designation for that figure. The numerical result describes the classifier being explained. The comparison of explanation methods is qualitative.

The highlighted vocabulary includes words whose association with the predicted category makes immediate sense and tokens whose influence invites further inspection. In the illustrated comparison, church and service support the Christianity category, and even the token 13 is associated with that category. The agreement between LIME and gradients concerns the direction and relative strength of the relevant word features as well as their identity. A reader still needs to decide whether a given association is a reasonable basis for text classification.

The gradient display typically covers more vocabulary coordinates. Some correspond to words absent from the document. A derivative at one of those positions says something about the neighborhood of the document’s feature vector, where increasing that coordinate could change the prediction. Reading it as the effect of a complete edit to the original text would require an additional step, since an edit is a change to a document and the derivative is taken in its numerical representation.

In longer documents, the authors find influential features in gradients that LIME leaves out. They point to the chosen size of the sparse explanation and to the limited number of perturbation samples as possible reasons. Across the automatic search rounds, the strongest word associations shift, and many remain intuitively related to the categories. Training accuracy for these candidates is mostly high. Test accuracy is unstable, so the changes show that the procedure finds different text dependencies, with mixed evidence about their predictive value.

Iris-Cancer tests what happens when a group of features disappears

The authors build a composite dataset by pairing measurements from Iris classes 1 and 2 with measurements from the first 50 examples of each class in Breast Cancer Wisconsin. The resulting matrix has 100 examples with 34 features and a binary outcome. The flower measurements play the role of an accompanying source of information that is available in training and can be withheld at test time.

With all the features intact, the unconstrained classifier averages 92% test accuracy over 350 random training and test splits. The procedure assigns two thirds to training and one third to testing. The authors then take away the 4 Iris coordinates on the test side. Average test accuracy drops to 81%, and the scores vary more across splits. Here the membership of the suspect feature group is known, and the effect of withholding it supplies an independent check on whether the classifier used it.

Average Iris-Cancer test accuracy without explanation constraints

The classifier scores higher when the test inputs retain the Iris measurements.

Average Iris-Cancer test accuracy without explanation constraintsIris measurements withheld at test: 81Iris measurements withheld at test81Iris measurements present at test (this paper): 92Iris measurements present at test (thispaper)92
The numbers
System or settingaccuracy %
Iris measurements withheld at test81
Iris measurements present at test (this paper)92

The gradient explanation points to the Iris coordinates. In the LIME comparison, the identified prominent feature comes from the cancer data even when the authors vary the perturbation strategy. The drop in test accuracy demonstrates why overlooking the Iris dependency matters. The authors suggest that a continuous table can be a difficult setting for a method whose useful perturbations often involve masking a small number of meaningful groups. The derivative instead measures how the output responds locally in the continuous feature coordinates.

When the training mask marks the Iris coordinates, accuracy with and without those coordinates at test time becomes nearly the same. The paper describes this as recovering performance under the changed condition. In the annotation-free search, the starting classifier has strong Iris sensitivities, high training accuracy, and weaker accuracy when tested without the Iris information. Subsequent candidates show smaller Iris gradients and better test accuracy even as their training accuracy falls. The authors report standard deviations across 50 trials in the figure for this search. That trial count belongs to the iterative comparison, while 350 describes the random splits used for the supervised confound experiment.

Decoy MNIST changes what the patch can predict

The ordinary MNIST baseline is the same architecture trained on handwriting without the artificial patches. It achieves 98% training accuracy and 96% test accuracy. For Decoy MNIST, the authors insert gray swatches of size 4 × 4 in randomly selected corners. In training, the shade is assigned from the known digit.

Training swatch shade = 255 − 25y

Here, y denotes the digit class, and 25y means 25 multiplied by that digit. The numbers 255 and 25 set the starting shade and the step that links it to the label. At test time, the shade is random. The swatch still appears in the image, which lets the authors change its predictive relation to the label while preserving the presence of the potentially distracting object.

Ordinary training on the decoy data gives 99.6% accuracy on the training set and 55% on the test set with randomized shades. In an illustrated error, a 7 is classified as a 3. Both gradient and LIME explanations implicate the corner swatch. The gradient display also indicates where making marks along or beyond strokes would locally alter the probability of a digit. Because LIME varies larger groups of pixels together in this experiment, its display better conveys the visual importance of the main body of the handwriting.

With the swatch positions marked in the training annotations, the authors report test accuracy on the randomized-shade inputs matching the standard-MNIST baseline. The result compares a classifier trained with misleading patches and feedback about them with the performance of the architecture on the ordinary task. The paper gives the 96% test number for standard MNIST. Its account of the constrained run reports a match to that reference.

The automatic procedure also recovers baseline performance on Decoy MNIST after its first round of retraining. Across the confounded digit and tabular tasks, the figure caption describes success after 1-2 iterations. Later digit explanations sometimes distribute sensitivity in recognizable ways along distinctive strokes. For some images at the last iteration, the swatch becomes influential again. The best outcome occurs along the search trajectory, which makes the choice of when to inspect and stop consequential.

How the computation differs

LIME needs outputs for multiple perturbed examples to fit each local explanation. Its cost depends on how many samples are taken and how the altered examples are constructed. A gradient explanation for an input takes computation of approximately the order of a prediction, according to the authors. For the text setup, the derivative is calculated over the feature vector, whose size is fixed by the vocabulary representation. A long document presents a different sampling problem for LIME because there are more words whose influence the perturbations might need to expose.

The paper compares timings per explanation on a laptop. It uses text and image variants of LIME for the corresponding tasks, continuous tabular perturbations for Iris-Cancer, and discretized tabular perturbations for Toy Color. The authors describe the timings as an indication of scale and note that their gradient calculation was unoptimized. The comparison supports the claim that generating direct explanations can be much cheaper than repeated sampling in these settings. The full training cost also includes differentiating through those explanations during the parameter updates.

What the ablations show

Penalty strength and annotation coverage govern the rule transition

The Toy Color transition experiment varies λ₁ and the number of training rows with marked corners. It then looks at the locations of the large gradient components on 1000 test examples, using a cutoff of 0.67. The analysis compares the share of selected components in the corners with the share in the top middle. The two fractions almost always add to 1, indicating that attention in the sense of local sensitivity stays concentrated on the regions the data construction made useful, even as the balance shifts.

A broad intermediate range shows mixtures of the rules. This gives a more informative picture than a comparison of an unconstrained fit with a strongly constrained fit alone. A classifier can respond to a weaker corner penalty by drawing on both regions. It can retain good predictions in the constructed task because the rules agree there. The explanation measurements reveal that the change in the fitted decision rule can be gradual.

The minibatch comparison changes the opportunity for the annotated examples to influence optimization. Under the authors’ sampling change, the small annotated collection is present regularly in the gradient updates. The result with 50 marked examples therefore reflects both the information in those examples and their exposure during training. The experiment establishes that the labels on the many unmarked examples and the feedback on a small subset can work together in this setup. It gives no separate estimate of the cost of obtaining similarly precise masks for other inputs.

Relative loss size explains the useful range of λ₁

The cross-validation analysis plots performance over explanation strengths and relates it to the initial magnitudes of the weighted explanation loss and cross-entropy. The best region occurs where the terms are broadly comparable. The authors report that a discrepancy of an order of magnitude need not materially affect accuracy in that analysis. This makes the balance a range of useful settings.

The curve has an interpretation rooted in the objective. With a small explanation weight, the available reduction in classification loss can justify using a marked feature. With a large enough weight, a much smaller derivative can become valuable even if the predictions get worse. The authors observe chance-level accuracy in the extreme regime. Performance there says as much about the loss being dominated by the penalty as it does about the availability of a good alternative decision rule.

This helps explain the authors’ caution about the final Toy Color run. In the search figure, λ₁ is 10³ for θ₁ and 10⁶ for θ₂. The lower of those settings helps bring out the alternative. The later result combines a broader accumulated mask with a much larger weight, so it gives limited leverage for assigning the loss of accuracy to either change separately. The authors place more emphasis on the failure to reveal another stable explanation at that stage.

The amount of data saved depends on which rule remains available

The reduced-data appendix varies the training set size on Toy Color and compares positional masks. λ₁ is chosen at each size to bring the loss terms into balance. With a mask that penalizes all pixels outside the corners, the authors reach 95% accuracy using fewer than 100 training examples. They report needing nearly 10,000 training examples to reach the same accuracy level with an empty mask. The appendix gives the metric as accuracy without naming the evaluation split for that threshold.

Restricting sensitivity to the corners gives the learner useful information about where to look, and leaves available the rule it already tends to discover. Other masks also help in the experiment. Penalizing the top-middle pixels favors use of the corners, while penalizing everything outside the top middle points towards the alternative region. Penalizing the corners alone hurts accuracy until the training set reaches a threshold size. That mask excludes the preferred route without specifying which of the many unmarked locations contains the useful alternative.

The authors suggest a reason the two regions may differ in difficulty. There are 4 ways for the corners to share a color and 24 ways for the top-middle pixels to have distinct colors. They offer this comparison as a possible explanation for why learning the second rule from positions and labels may take more observations. Positional feedback can shrink the portion of the input the learner needs to explore, but the examples still have to teach the relation among the coordinates in that portion. The experiment measures those effects in a deliberately simple task.

Alternative explanations can vary in more than usefulness

In Iris-Cancer, the automatic search changes both the gradient distribution and the tradeoff between training and altered-test performance. A decrease in training accuracy is compatible with an improvement when the Iris measurements are withheld. The subsequent classifiers give up a dependency that was helpful to fit the composite training examples. The accompanying reduction in Iris gradients makes that reading more credible than the test score would on its own.

In Decoy MNIST, the useful alternative appears early. As the penalty becomes much larger than the classification term, the behavior becomes erratic. The authors also notice that some later gradients look more evenly distributed and align more intuitively with strokes. These are observations about the explanations on particular inputs. The eventual return of swatch sensitivity in some cases shows that intuitive stroke sensitivities can coexist with residual dependence on the decoy.

The text comparison reinforces this distinction from another direction. There, the set of associated words changes without consistently improving test accuracy. The search can exploit redundant evidence in a dataset, giving classifiers that agree on many examples while placing weight on different features. How much that diversity helps depends on whether the new dependencies continue to support decisions under the conditions that matter.

Explanation comparisons expose what the display can resolve

The comparison with LIME varies the explanation procedure while holding the classifier being inspected fixed. Agreement in Toy Color is informative because the candidate rules have known locations. On the tabular task, withholding the Iris features adds a behavioral check that gives the gradient diagnosis more weight than visual plausibility alone would provide. In the digit task, a display at the level of pixel derivatives and one based on larger grouped perturbations can each answer a useful question.

These comparisons give the explanation tradeoff a concrete scale. Grouping nearby pixels helps a reader see that a stroke or the main body of a digit is consequential under a larger alteration. A fine-grained derivative gives a local indication of how brightening an apparently empty pixel could start to change the evidence. The paper’s strongest case for using gradients in training rests on that defined local quantity and on the ability to penalize it repeatedly across examples. The usefulness of a coarser display for a human reader is compatible with that choice.

Limitations

Limits the authors identify

The authors characterize the gradient as a first-order account of the classifier around the observed input. When a predicted probability is already nearly flat, the derivative can be small even for features a person would recognize as essential to the object. A small adjustment on a central stroke and removal of the stroke are different interventions. The derivative describes the former directly. To assess the latter, a reviewer needs evidence about behavior over a larger change. The authors discuss other approaches to attribution in connection with this difficulty. Propagation of Activation Differences.

The authors also flag the problem of feature meaning. The mathematical explanation is expressed in the coordinates that enter the classifier. A pixel-by-pixel pattern may require substantial interpretation, and an individual coordinate of a word embedding may have no readily identifiable linguistic meaning for a reviewer. The same issue applies when writing the mask. Knowing that a concept should be irrelevant is helpful only to the extent that this judgment can be expressed over coordinates for particular examples. The paper names distributed representations as a setting where both reading explanations and specifying constraints can be difficult. Word embeddings.

The automatic search leaves candidate selection to the expert. Its accumulated mask depends on the gradients and cutoff used to construct it, and the paper reports sensitivity to the strength of the next training penalty. The authors suggest that different classifiers may be appropriate in different regions of the input space. The ability to show several candidates helps make those differences inspectable. The labeling time, quality of reviewer judgments, and performance of an interactive process remain open.

The authors’ conclusion proposes weighted annotations, an L1 penalty to encourage sparse gradients, and class-specific ways to express whether a feature should support or oppose a prediction. It also raises possible uses in adversarial robustness and in questions of accountability or fairness. These suggestions define directions beyond the tested masks and shifts. The reported experiments measure label accuracy and local dependence in the selected tasks, leaving those broader uses to future evaluation. Bias, fairness and safety.

Limits that follow from the experimental setup

The strongest transfer evidence comes from deliberate interventions. The researchers know both how the decoy digit cue was produced and which set of coordinates in the table comes from Iris. That knowledge helps them construct a meaningful mask and a decisive change at test time. In an application where a shortcut is subtle, overlapping with legitimate evidence, or spread across the representation, the steps of identifying and specifying the unwanted dependency would themselves require evaluation. The paper’s text experiment shows how gradients can expose questionable word associations, with less direct evidence about which of those associations an expert would remove and what replacement evidence would generalize.

The gradient penalty operates at sampled points, in the specified coordinates, for the scalar quantity in the loss. A response elsewhere can be stronger, a large change can cross parts of the decision surface that the penalty never encounters, and a classifier can retain some sensitivity because the objective is soft. The sum of log probability gradients also permits offsetting changes among classes. Accordingly, low penalized sensitivity at the annotated points supports a local behavioral claim. Establishing that an entire class of inputs is insensitive to a cue would require evidence across those inputs and the output changes relevant to that requirement.

The experiments use a small, shared architecture across diverse inputs. That breadth helps show that the mechanism has uses beyond a single data format. It leaves the choice of settings, training cost, and legibility of the explanations open for other architectures and feature representations. The text inputs in particular have identifiable vocabulary coordinates, which gives the displays a direct route to words that need not exist with a different numerical representation.

The evidence about readability is based on examples and comparisons with known interventions. The paper leaves open how consistently people with domain expertise can diagnose an unfamiliar situation from these displays, how much explanation detail helps, and whether a simpler display would lead to better judgments. The runtime comparison has a similarly specific scope. It measures individual explanations with input-dependent variants of LIME in the stated implementation, with the training overhead of the derivative penalty a separate question.

Finally, a search that stops finding new high-accuracy candidates has reached a limit of the particular search. The initialization, cutoff, penalty, architecture, and optimization all influence which rules are reached. The number of discovered alternatives can suggest redundancy in a dataset, as the authors propose. A complete inventory of the possible rules would require a different kind of evidence. Late swatch sensitivity on Decoy MNIST gives a concrete reason to assess each candidate’s behavior even when its training run was constrained by the history of earlier explanations.

What came after

Explaining behavior and judging explanatory evidence

The later citation record follows the paper into several areas that ask what a prediction explanation should establish. It supports connections at the level of those research questions and identifies the subjects of the citing works. Details of how each citation is used, including any direct reuse of the penalty, remain unspecified.

Arrieta and colleagues address explainable artificial intelligence through concepts, taxonomies, and challenges for responsible use. The earlier paper gives that organizing question a concrete case. A derivative can be an explanation of local behavior, a clue for an expert who is inspecting evidence, and an ingredient in an objective used to change the classifier. Those roles put distinct demands on the same quantity. The citation connects the training intervention to a broader discussion of what explainability is supposed to accomplish. Explainable Artificial Intelligence.

Danilevsky and colleagues survey explainability in natural language processing. In the earlier paper’s language task, a word feature can be important because it occurs in the document, or because inserting it would change the prediction. An explanation may describe either kind of dependency, and a reviewer may care about both when deciding whether the classifier has adopted a spurious cue. The citation ties the local explanation and the possibility of acting on it to the broader study of language explanations. A Survey of Explainable AI for Natural Language Processing.

The works by Jain and Wallace, Serrano and Smith, and Wiegreffe and Pinter take up the relation between attention and explanation. Jain and Wallace frame their work around a challenge to treating attention as explanation. Serrano and Smith pose the interpretability question explicitly. Wiegreffe and Pinter frame their title as a response within that debate. The shared issue illustrated by the earlier paper is that an explanation needs a specified relationship to behavior. For its class-probability gradients, the relationship is the immediate change under a small input variation. For the attention debate, the titles place the evidentiary role of a different quantity at the center of the question. Attention is not Explanation, Is Attention Interpretable?, and Attention is not not Explanation.

Explanations as training evidence and as data

Hsieh and colleagues study distillation in connection with smaller systems and less training data. The link to the earlier work is the question of what can be learned when supervision carries information beyond the target label. Toy Color offers a controlled example. Guidance about which image regions may matter improves learning from fewer examples when it makes a usable rule easier to discover. The later title places the economy of training examples in a different setting, centered on distillation, while the citation record leaves the mechanism of the connection open. Distilling Step-by-Step!.

Lamm and colleagues present QED as a framework and dataset for explanations in question answering. That subject makes the distinction between an answer and its basis part of what the data are organized to study. In the earlier experiments, the same label can be reached through different features, so evaluating the answer gives an incomplete picture of which rule was learned. The framework and dataset named by QED carry the question about explanatory evidence into an answer-centered task. QED.

Akter and colleagues study complex visual reasoning with unanswerable questions. The connection is the role of available evidence in deciding what an answer can establish. In the decoy experiment, the visual input has a conspicuous cue that is predictive in training and uninformative at test time. The later work’s title foregrounds a different challenge, in which the availability of sufficient evidence to answer the question is itself at issue. Both subjects make the conditions under which a response is earned part of the evaluation. VISREAS.

Shortcut control and safety

Gao and colleagues explicitly address implicit shortcut reliance in automated assessment of spoken English as a second language. That is the closest later subject in the list to the decoy experiments. In the earlier paper, the researchers can give a shortcut an operational meaning by constructing a cue that predicts the training labels and then changing its association with the answer at test time. The later title places the control of shortcut reliance in a setting where a score concerns spoken language. The citation establishes continuity of the problem across the settings, with the later paper’s choice of controls and results left unspecified. Controlling Implicit Shortcut Reliance in L2 Spoken English Auto-markers.

Anwar and colleagues frame their work around foundational challenges in assuring alignment and safety for large language systems. The original paper already identifies robustness and accountability as potential applications of explanation constraints. Its concrete bearing on the broader assurance question is the demonstration that a high score on familiar data can coexist with a fragile dependency, and that one can test that dependency by changing the evidence available at evaluation. The citation brings that concern into a wider safety agenda, where claims about acceptable behavior depend on how well the evaluations expose the rules behind successful outputs. Foundational Challenges in Assuring Alignment and Safety.

Cite

Cite as Andrew Slavin Ross, Michael C. Hughes and Finale Doshi‐Velez. 2017. Right for the Right Reasons: Training Differentiable Models by Constraining their Explanations. International Joint Conference on Artificial Intelligence.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.24963/ijcai.2017/371 · arXiv 1703.03717

@inproceedings{ross2017right,
  title = {{Right for the Right Reasons: Training Differentiable Models by Constraining their Explanations}},
  author = {Andrew Slavin Ross, Michael C. Hughes and Finale Doshi‐Velez},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.24963/ijcai.2017/371},
  eprint = {1703.03717},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.24963/ijcai.2017/371}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/ross-2017-right-right-reasons-training-differentiable/

References

34 references, from the paper's own bibliography.

  1. Philip Adler, Casey Falk, Sorelle A Friedler, Gabriel Rybeck, Carlos Scheidegger, Brandon Smith, and Suresh Venkatasubramanian. Auditing black-box models by obscuring features. arXiv preprint arXiv:1602.07043, 2016. OpenAlex ↗ · Scholar ↗
  2. Sebastian Bach, Alexander Binder, Grégoire Montavon, Frederick Klauschen, Klaus-Robert Müller, and Wojciech Samek. On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PloS one, 10(7):e0130140, 2015. OpenAlex ↗ · Scholar ↗
  3. David Baehrens, Timon Schroeter, Stefan Harmeling, Motoaki Kawanabe, Katja Hansen, and Klaus-Robert MÞller. How to explain individual classification decisions. Journal of Machine Learning Research, 11(Jun):1803–1831, 2010. OpenAlex ↗ · Scholar ↗
  4. Rich Caruana, Yin Lou, Johannes Gehrke, Paul Koch, Marc Sturm, and Noemie Elhadad. Intelligible models for healthcare: Predicting pneumonia risk and hospital 30-day readmission. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1721–1730. ACM, 2015. OpenAlex ↗ · Scholar ↗
  5. Jeff Donahue and Kristen Grauman. Annotator rationales for visual recognition. In 2011 International Conference on Computer Vision, pages 1395–1402. IEEE, 2011. OpenAlex ↗ · Scholar ↗
  6. Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608, 2017. our card
  7. Harris Drucker and Yann Le Cun. Improving generalization performance using double backpropagation. IEEE Transactions on Neural Networks, 3(6):991–997, 1992. OpenAlex ↗ · Scholar ↗
  8. Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness through awareness. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, pages 214–226. ACM, 2012. OpenAlex ↗ · Scholar ↗
  9. Ruth Fong and Andrea Vedaldi. Interpretable explanations of black boxes by meaningful perturbation. arXiv preprint arXiv:1704.03296, 2017. OpenAlex ↗ · Scholar ↗
  10. Yotam Hechtlinger. Interpretation of prediction models using the input gradient. arXiv preprint arXiv:1611.07634, 2016. OpenAlex ↗ · Scholar ↗
  11. Frank C Keil. Explanation and understanding. Annu. Rev. Psychol., 57:227–254, 2006. OpenAlex ↗ · Scholar ↗
  12. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. our card
  13. Yann LeCun, Corinna Cortes, and Christopher J.C. Burges. The MNIST database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 2010. OpenAlex ↗ · Scholar ↗
  14. Tao Lei, Regina Barzilay, and Tommi Jaakkola. Rationalizing neural predictions. arXiv preprint arXiv:1606.04155, 2016. OpenAlex ↗ · Scholar ↗
  15. Jiwei Li, Xinlei Chen, Eduard Hovy, and Dan Jurafsky. Visualizing and understanding neural models in NLP. arXiv preprint arXiv:1506.01066, 2015. our card
  16. Jiwei Li, Will Monroe, and Dan Jurafsky. Understanding neural networks through representation erasure. arXiv preprint arXiv:1612.08220, 2016. our card
  17. M. Lichman. UCI machine learning repository. http://archive.ics.uci.edu/ml, 2013. OpenAlex ↗ · Scholar ↗
  18. Zachary C Lipton. The mythos of model interpretability. arXiv preprint arXiv:1606.03490, 2016. OpenAlex ↗ · Scholar ↗
  19. Scott Lundberg and Su-In Lee. An unexpected unity among methods for interpreting model predictions. arXiv preprint arXiv:1611.07478, 2016. OpenAlex ↗ · Scholar ↗
  20. Dougal Mclaurin, David Duvenaud, and Matt Johnson. Autograd. https://github.com/HIPS/autograd, 2017. OpenAlex ↗ · Scholar ↗
  21. Grégoire Montavon, Sebastian Lapuschkin, Alexander Binder, Wojciech Samek, and Klaus-Robert Müller. Explaining nonlinear classification decisions with deep taylor decomposition. Pattern Recognition, 65:211–222, 2017. OpenAlex ↗ · Scholar ↗
  22. Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In Security and Privacy (SP), 2016 IEEE Symposium on, pages 582–597. IEEE, 2016. OpenAlex ↗ · Scholar ↗
  23. Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should I trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1135–1144. ACM, 2016. our card
  24. Marco Tulio Ribeiro. LIME. https://github.com/marcotcr/lime, 2016. OpenAlex ↗ · Scholar ↗
  25. Ramprasaath R Selvaraju, Abhishek Das, Ramakrishna Vedantam, Michael Cogswell, Devi Parikh, and Dhruv Batra. Grad-CAM: Why did you say that? arXiv preprint arXiv:1611.07450, 2016. OpenAlex ↗ · Scholar ↗
  26. Avanti Shrikumar, Peyton Greenside, Anna Shcherbina, and Anshul Kundaje. Not just a black box: Learning important features through propagating activation differences. arXiv preprint arXiv:1605.01713, 2016. our card
  27. Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. arXiv preprint arXiv:1704.02685, 2017. our card
  28. Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013. our card
  29. Sameer Singh, Marco Tulio Ribeiro, and Carlos Guestrin. Programs as black-box explanations. arXiv preprint arXiv:1611.07579, 2016. OpenAlex ↗ · Scholar ↗
  30. Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Gradients of counterfactuals. arXiv preprint arXiv:1611.02639, 2016. OpenAlex ↗ · Scholar ↗
  31. Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. arXiv preprint arXiv:1610.08452, 2016. OpenAlex ↗ · Scholar ↗
  32. Omar Zaidan, Jason Eisner, and Christine D Piatko. Using "annotator rationales" to improve machine learning for text categorization. In HLT-NAACL, pages 260–267. Citeseer, 2007. our card
  33. Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818–833. Springer, 2014. our card
  34. Ye Zhang, Iain Marshall, and Byron C Wallace. Rationale-augmented convolutional neural networks for text classification. arXiv preprint arXiv:1605.04469, 2016. OpenAlex ↗ · Scholar ↗